Help me to resolve this issue

raja123
Member Posts: 50
I'm using nav 2017,
Process: I'm assigning the department code to purchase header department code field (reverse to standard) and if any one line's department code changes then remaining lines also changes and purchase header department code also changes.
Issue : 1)I want to empty department code field in purchase header if all the purchase lines are deleted.
2) the department code for purchase line is not auto updating as there is a code in no invalidate() trigger to auto fill department code for purchase lines
Process: I'm assigning the department code to purchase header department code field (reverse to standard) and if any one line's department code changes then remaining lines also changes and purchase header department code also changes.
Issue : 1)I want to empty department code field in purchase header if all the purchase lines are deleted.
2) the department code for purchase line is not auto updating as there is a code in no invalidate() trigger to auto fill department code for purchase lines
0
Best Answer
-
Hi @raja123.
Issue 1: You can check if there are any more purchase lines in the purchase order using the OnDelete trigger of the Purchase Line, and if the line you're deleting is the last one, you then clean the department code for the purchase order.
Issue 2: If i got it correctly, what you're saying is that the department code is filled "standardly" in the "No." OnValidate trigger. What you'll need to do depends on your requisites... If you want to always have the department code of your last added purchase line, you'll have to update the rest of the purchase lines in the order with the current department given in the "No." OnValidate trigger. If you want to always have the last updated purchase line department code (if you change the 2nd purchase line department code) you'll also have to write code to the Global Dimension 1 Code OnValidate trigger.
Issue 2 really depends on what your outcome is supposed to be.5
Answers
-
Hi @raja123.
Issue 1: You can check if there are any more purchase lines in the purchase order using the OnDelete trigger of the Purchase Line, and if the line you're deleting is the last one, you then clean the department code for the purchase order.
Issue 2: If i got it correctly, what you're saying is that the department code is filled "standardly" in the "No." OnValidate trigger. What you'll need to do depends on your requisites... If you want to always have the department code of your last added purchase line, you'll have to update the rest of the purchase lines in the order with the current department given in the "No." OnValidate trigger. If you want to always have the last updated purchase line department code (if you change the 2nd purchase line department code) you'll also have to write code to the Global Dimension 1 Code OnValidate trigger.
Issue 2 really depends on what your outcome is supposed to be.5
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