I have created a field on the Posted sales Shipment called "Sell-to Contact No.". This should populate from the Phone No. of the Ship-to Address List which is shown from a drop down on the Ship-to code on the posted sales shipment.
Here's my current code for modyfying the record. How can I add this additional feature.
OnRun(VAR Rec : Record "Sales Shipment Header")
SalesShptHeader := Rec;
SalesShptHeader.LOCKTABLE;
SalesShptHeader.FIND;
//populate Ship-to Phone No. in Shipping
SalesShptHeader."Shipping Agent Code" := "Shipping Agent Code";
SalesShptHeader."Shipping Agent Service Code" := "Shipping Agent Service Code";
SalesShptHeader."Package Tracking No." := "Package Tracking No.";
SalesShptHeader."Sell-to Contact No." := "Sell-to Contact No.";
cuSalesMgmnt.SalesShipmentHeaderModify(SalesShptHeader, Rec); // TIO000001
SalesShptHeader.MODIFY;
Rec := SalesShptHeader;
Answers
IF recShiptoAddress.GET(SalesShptHeader."Sell-to Customer No.",SalesShptHeader."Ship-to Code") THEN
SalesShptHeader."Ship-to Contact No." := recShiptoAddress."Phone No.";
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav