//find the item record whose no matches invoice line's item no
// if a record found, get the container code, else return nothing
IF recItem.FINDFIRST THEN
gContainerCode := recItem."Container Code"
gContainerCode := '';
I don't get any errors :-)but i don't get a value either :-(Anyone got any ideas?
I would just get the Item record, then reference the fields directly (i.e. recitem."No.", recItem.Description, recItem."Container Code").
You'd only really need to use a variable to store the values if you want to manipulate them or use it at a later time outside the OnAfterRecord trigger.
Andrew Drott ERP Lead Developer Gogo Business Aviation | 105 Edgeview Drive | Broomfield, CO 80021 | USA | O: +1 303 301 3320 | M: +1 312 231 8085
IF recItem.FINDFIRST THEN BEGIN recItem.CALCFIELDS("Container Code");
gContainerCode := recItem."Container Code";
If you've found this thread useful, dive deeper into User Group community content by role