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;
Variables:
gRecPurchaseLine, Record (Purchase Line)
gCodVendorOrderNo, Code
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’.