How to prevent a user from deleting specific order lines

bob_up
Member Posts: 155
I have modified the sales order header so that the user can enter a carriage amount. When they do this, a G/L order line is automatically created with a boolean to identify that it is a special type of line. I have added some code to the order line OnDelete trigger to warn the user if they try to delete this carriage line. This works as intended
However the code in the OnDelete trigger of the order lines is also executed if the user tries to delete the whole order. I dont want to display the warning in that situation.
Is there some way to know if the order line is being deleted because the whole order is being deleted ?
However the code in the OnDelete trigger of the order lines is also executed if the user tries to delete the whole order. I dont want to display the warning in that situation.
Is there some way to know if the order line is being deleted because the whole order is being deleted ?
0
Answers
-
look at the CURRENTFIELD function.David Singleton0
-
-
DenSter wrote:I think David means CurrFieldNo
He does
Someone needs to tell Luc that F11 doesn't work on MiBuSo.David Singleton0 -
Go through this link....http://www.mibuso.com/forum/viewtopic.php?f=23&t=449630
-
Thank you all for your advice. It helped me to look at my problem in a new way and realise that there was a simple solution.
In the OnDelete trigger of the sales header I now clear down the "Carriage Line" check box on any sales lines for that order. Therefore, when the lines are deleted the confirmation message doesnt get displayed.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
- 322 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