Hi all,
I need to add to my XMLPort solution for an interface some logic to allow check the existence of a field before I try to bring the data to the XML content.
Then I have several databases where the Value Entry table can have or not the field SALESPERSON, so depending on wich database I’m running on I need to know if the field exists previous to use it on the rest of the logic.
How can I get that information without getting an error on compile because the field does not exist?
I think something as:
xVarName := ‘FIELDX’;
nVarPos := FIELDNO( xVarName );
If nVarPos > 0 THEN
myVar := table.FIELD( nVarPos )
Else
myVar := ‘NOT FOUND’;
I tried several things I’ve found on other posts and forums, like:
Lookup(Field.FieldName WHERE (TableNo=CONST(27),No.=FIELD(FieldID Filter)))
or
CASE varFieldname Of
Rec.FIELDNAME(FieldName1):
Rec.SETCURRENTKEY(Fieldset1);
Rec.FIELDNAME(FieldName2):
Rec.SETCURRENTKEY(Fieldset2);
END;
I thank so much if somebody can givme a sample on how to do this on NAV
I’m running NAV 5.0 SP1
Regards