So we've got a sales order. And we want to show a cross-reference number if one exists for a given item. I think I'm doing this right but no data ever comes in ... here's my code:
IF crossRefRec.GET("No.") THEN
display := crossRefRec."Cross-Reference No.";
"No." is the item number on the Sales Line, and that should automatically link to the "Item No." in the "Item Cross Reference" table, correct?
The item exists, the cross reference for that item exists, the "Cross-Reference No." exists, but "display" variable never gets any data in it. Is there something weird going on with cross-reference tables that I don't understand?
Any help would be greatly appreciated, thanks!

[/code]
Comments
The primary key for CrossRefRec is
Item No.,Variant Code,Unit of Measure,Cross-Reference Type,Cross-Reference Type No.,Cross-Reference No.
and you are passing "No." from sales line?
Try this
if type = type::Item then begin
crossRefRec.reset;
crossRefRec.setrange("Item No.","No.");
crossRefRec.setrange("variant Code","Variant Code");
//put other filters for crossref for example Cross-refference type or UOM
if crossRefRec.find('-') then
display := crossRefRec."Cross-Reference No.";
end;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n