Create a new form, based on table “Field” using the wizard as a “Tabular-Type Form”. Add the fields : - TableNo - No. - FieldName - RelationTableNo Run the form, filter on “TableNo=27”. As you can see, the field “7 Class” has a RelationTable 6222, OK so far. BUT, field “8 Base Unit of Measure” do NOT have a RelationTable !!! Why not, in table 27, the field DO HAVE a tablerelation [xx(]
Many souls have been frustrated by this… When the ‘TableRelation’ expression is just a table name, the RelationTableNo field is given. When the ‘TableRelation’ is more complex, it is not… [sigh]
In fact you could use the fieldref variable of the real field which means: RecRef.OPEN(27); FRef := RecRef.FIELD(8); MESSAGE(FORMAT(FRef.RELATION));
will show 5404 which is what you are interested in, I guess. Even if the relation is part of an IF condition this works (depending on other fields in the RecRef you have, which means you might need to position to a certain record first so Navision gets the chance to evaluate the condition properly).
Thank you
Hi Thomas, thank you for you little sample. It works, IF you refer to a field that DO have a tablerelation, but : If I try the following, Navisin crashes [:(] RecRef.OPEN(27); FldRef := RecRef.FIELD(1); // Field “1 No.” do NOT have a TableRel MESSAGE(FORMAT(FldRef.RELATION)); So how can I avoid Naviosion from closing down ?