C/AL Code: Short table names reference

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);

Look at View → C/AL Globals, or View → C/AL Locals to see the names of the variables, their types, and what they refer to.

Thank you. That was what I was missing.

and if you can’t find them in the globals list, it could also be a local variable.

Another way to see which table that the variable is related to is to put your cursor in the variable name in the C/AL editor, and the table will show up in the status bar in the lower left corner.