Different Salesperson Code on Ship-To's

Savatage
Member Posts: 7,142
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!
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
-
Ship-To Code - OnValidate() if "Ship-To Code" <> '' then begin //ship-to code is entered ShipToAddr.GET("Ship-To Code"); VALIDATE("Salesperson Code",ShipToAddr."Ship-To Salesperson Code"); end else begin //ship-to code is empty - take code from customer Customers.GET("Sell-To Code"); VALIDATE("Salesperson Code",Customers."Salesperson Code"); end;
0 -
Don't forget to add code to the Sell-to Customer code validation to leave the salesperson field alone if there is a ship-to.
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions