Hello All
I have added a new field to the Sales Header Form (orders). This is ship-to territory. I want this to default to the value already selected in the territory field in the Customer card.
If required the user can then change this value by looking up the territory code (already done this).
What is the best approach for achieving this?
Thanks
0
Comments
Something like:
Customer.RESET;
Customer.SETFILTER("No.","Sales Order".CustomerNo);
IF Customer.FIND('-') THEN
NewField := Customer.TerritoryField;
That will work once the record has been inserted to the DB
From a processing point of view I would recommend:
On Validate trigger of the "Sell-to Customer No." field look for the following statement:
GetCust("Sell-to Customer No.");
There is a whole section of code that deals with getting information from the customer card. All you would need to do is add the following line:
NewField := Customer.TerritoryField;
Job Sorted
The advantage to this is that yo are not repeating any GET functions AND if the customer is changed for whatever reason, then this would form part of the STANDARD replace customer routine .
Dean
Or that.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯