Empty value in FieldRef

robthemobbrobthemobb Member Posts: 13
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?
RecId := SalesHeader.RECORDID;
RecRef := RecId.GETRECORD;

FieldRef := RecRef.Field(1);

FieldRef2 := RecRef.Field(2);

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

Best Answer


Sign In or Register to comment.