Empty value in FieldRef

robthemobbrobthemobb Posts: 13Member
Hey folks,

this piece of code seems quite trivial, but I am stuck with it.
I would have expected to get the Document Type in the first Message and the Sell-to Customer No. in the two latter ones, but NAV shows only the Doc Types value. Am I missing something? Obviously, but what? I first ran into this in Business Central, then tried to narrow it down in NAV2018.

Why is there no value for the Customer No?
SalesHeader.FINDFIRST;
RecId := SalesHeader.RECORDID;
RecRef := RecId.GETRECORD;

FieldRef := RecRef.Field(1);
Message(Format(FieldRef));

FieldRef2 := RecRef.Field(2);
Message(Format(FieldRef2));

// CU 701 DataTypeManagement
DataTypeManagement.FindFieldByName(RecRef, FieldRef2, 'Sell-to Customer No.');
Message(Format(FieldRef2));

Best Answer

Answers

Sign In or Register to comment.