Kjærsgaard
10/5/2005 9:43:00 AM
Thank you very much for your reply. I can tell you - you do make a difference
:-)
I think you are possibly right about Parent/Child objects, the terminology
is new to me but it sounds likely.
Anyway, I think the classes are compiled in the right order - with the
parent/unique side first, Cust-class, or am I wrong?
static void CustBuyProd(Args _args)
{
Cust k1, k2, k3;
Product p1, p2, p3;
;
window 60,50;
k1 = new Cust("Lars Kjærsgaard", "Banegårdsvej 9, 2. th.");
k2 = new Cust("Marianne Grubak", "Kielgastvej 24");
k3 = new Cust("Helle Holteman", "Hemmersvej 51");
p1 = new Product("Axapta Development I", 9000);
p2 = new Product("Axapta Development II", 16000);
p3 = new Product("Axapta Development III", 9000);
--
Best regards
Lars
"hghrp" wrote:
> Hi,
>
> nothing wrong with your approach, but in Axapta it is common to use the
> parent class within the child - like in SalesLine:
>
> InventTable inventTable(ItemId itemId = this.itemId,
> boolean _forUpdate = false)
> {
> return InventTable::find(itemId, _forUpdate);
> }
>
> one item can be used in many sales lines, but one sales line can only have
> one item, so the item object is defined within the sales line, not the other
> way.
>
> you can then use
> SalesLine thisSalesLine;
> ;
> info(thisSalesLine.inventTable().ItemName);
>
> In X++ it is necessary to compile the objects in correct order, maybe your
> problem is because the parent class is not compiled when used within the
> child class.
>
> Hth,
> harald