any event or trigger to use after OnDelete()

vh8000
Member Posts: 23
Hi All
I have a page designed look like below:-
Piece | Weight
1 | 2.12
2 | 6.21
3 | 7.22
If user delete the second line (2 | 6.21), I would like to write my own code to auto. re-arrange the data like:-
Piece | Weight
1 | 2.12
2 | 7.22
I cannot use OnDelete() event because it triggered before the deletion.
Is this any Event / Trigger (something like OnAfterDelete()) I can use to do that?
Thanks
I have a page designed look like below:-
Piece | Weight
1 | 2.12
2 | 6.21
3 | 7.22
If user delete the second line (2 | 6.21), I would like to write my own code to auto. re-arrange the data like:-
Piece | Weight
1 | 2.12
2 | 7.22
I cannot use OnDelete() event because it triggered before the deletion.
Is this any Event / Trigger (something like OnAfterDelete()) I can use to do that?
Thanks
0
Comments
-
Even though the OnDelete trigger is executed before the record is actually deleted I think you should use that trigger.
In the OnDelete trigger you know what record is about to be deleted ( that is: the record that is the current record in the OnDelete trigger), so you can make the process you want to execute (in this case the renumbering) skip that record.Jan Veenendaal0 -
I have had the same problem several times, and found a workaround:
OnDelete() <some normal code> DELETE(FALSE); <the code requiring the record to be deleted> INSERT(FALSE);
I looks awful, but it does the job...
(It can also be used in the OnInsert() and OnModify() triggers with a few adjustments)Regards
Peter0 -
Don't you understand my solution, or doesn't it solve your case?Regards
Peter0 -
pdj wrote:Don't you understand my solution, or doesn't it solve your case?
Sorry for my late reply.
All methods suggested in this post created an unexpected result.
It might be the key I used in this table ("Document No.", "Line No.")
Anyways, thanks a lot for all helps.
I end up created an ActionItem that allow the user to "Rearrange the order".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