Restrict SalesRet&CredMem if UntCst-Item-stdcost>10%

rlawson
Member Posts: 48
I have Nav 4.0. My problem is:
Unit Cost on the item card gets corrupt as a result of unknown effects. To prevent positive adjustments from using the unit cost when it will be adjusted back, I want to add tolerance checking to posting. When Sales Returns or Credit Memos are posted, or Positive cost against Item Standard cost +/_ 10% (just error out and send a message to user to change the unitcost and do not post and roll back). If the cost is outside of tolerance error out.
I figured out that the check for tolerance code needs to be in Code Unit 80 for starters. The problem is where.
Unit Cost on the item card gets corrupt as a result of unknown effects. To prevent positive adjustments from using the unit cost when it will be adjusted back, I want to add tolerance checking to posting. When Sales Returns or Credit Memos are posted, or Positive cost against Item Standard cost +/_ 10% (just error out and send a message to user to change the unitcost and do not post and roll back). If the cost is outside of tolerance error out.
I figured out that the check for tolerance code needs to be in Code Unit 80 for starters. The problem is where.
0
Answers
-
Find the first loop through the sales lines. You need to place the check as soon as you can in order to skip much code and avoid rollbacks...
The first loop in the OnRun trigger... I don't know if we can be more specific since there might be a part of code for the localization that we don't have...0 -
Thank you.
I followed the CU80 to the first line and got into CU21 Item Jnl.-Check Line processing on Table 83 (this catches all positive adjustments and added it to RunCheck routine). So I checked for entry type # purchase; entrytype = sales and quantity = +; et= positive adj and + quantity and et = transfer and + quantity. I think that covers all necessary cases.0 -
I would also add a field to the Inventory Setup Table called "Tolerance Percent" - add it to the inv setup from there you can enter "10"
When your calculating your formula simply add:
InvtSetup.GET;
and change your "10" to "Tolerance Percent" in the formula.
This will allow you to adjust the amount in the future if needed without having to go find the code & change it everytime right from the Invsetup form.0 -
Already have done this. Also added, Cost Tolerance Flag due to multiple companies (to turn on and off).
Thanks for all your help0
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