Hi,
I am a new NAV user reviewing C/AL code and not sure how tables are referenced in code when a short form of the table name is used. For example. In the code below (from 5050 Contact table, ‘CreateVendor’ function), how does NAV know that “Vend” is the “Vendor” table or “ContBusRel” is reference to the “Contact Business Relation” table?
CLEAR(Vend);
Vend.SetInsertFromContact(TRUE);
Vend.INSERT(TRUE);
Vend.SetInsertFromContact(FALSE);
IF Type = Type::Company THEN
ContComp := Rec
ELSE
ContComp.GET(“Company No.”);
ContBusRel.“Contact No.” := ContComp.“No.”;
ContBusRel.“Business Relation Code” := RMSetup.“Bus. Rel. Code for Vendors”;
ContBusRel.“Link to Table” := ContBusRel.“Link to Table”::Vendor;
ContBusRel.“No.” := Vend.“No.”;
ContBusRel.INSERT(TRUE);