We have a few accounts that have 1 home office & 50 ship-to's.
We had them all setup as seperate accounts but to make EDI a little easier I changed them to all ship-to codes.
Now not every store has the same salesperson. I added a field to the Ship-to Address table called obviously "Ship-to Salesperson Code"
How can I get the salesperson code in the sales header of an order automatically change to the proper code.
the salesorder pulls the salesperson code from the customer card. I would need it then to see if a Ship-To code has been entered, and if so change it to the code on the ship-to address card.
not every customer has a ship-to address code so it's a left-outter join type of situation.
I figured on the
Ship-To Code - OnValidate()
"Salesperson Code" := "Ship-To Address"."Ship-To Salesperson Code";
feedback needed thanks!
0
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
What I'd do is create a new function on the Sales header called SetSalesperson or something, and add a call to this function to the sell-to customer code validation and the ship-to validation. That way you only have this code in one place and the salesperson should always be consistent.
Let me know if you need me to give you an idea of how to do this, and I'll post some code.
RIS Plus, LLC