In a report with data item Sales Line I wrote the following code in the OnAfterGetRecord:
IF gRecPurchaseLine.GET(“Sales Line”.“Purchase Order No.”,“Sales Line”.“Purch. Order Line No.”) THEN
gCodVendorOrderNo := gRecPurchaseLine.fCodVendorOrderNo;
gRecPurchaseLine, Record (Purchase Line)
The fCodVendorOrderNo in table Purchase Line is a custom field of type Code.
When running the report I get the error message ‘The expression Code cannot be type-converted to a Option value’.
I do not understand. What am I doing wrong?