<Solved> OnDatabaseModify trigger does not fire for PurchaseLine Table
jordi79
Member Posts: 285
Hi,
This test is done in Std Cronus, NAV2018 11.0.26893 .
1) In Codeunit1, function OnDatabaseModify, I put a breakpoint here.
2) Then I turn on the debugger
3) When I modify a record SalesLine table (Modified from table directly, not from Page), the debugger breaks on the OnDatabaseModify function
GREAT!!!
4) However when I modify a record in PurchseLine table (Modified from table directly, not from Page), the debugger DOES NOT break on the OnDatabaseModify function
NOT GREAT!!!
Why is it that changes in PurchaseLine table does not trigger OnDatabaseModify trigger?
I have also tested with other table such as Customer, Payment Terms, currency, and these tables fire the OnDatabaseModify function. But this does not seem to work on PurchaseLine.
Jordi
This test is done in Std Cronus, NAV2018 11.0.26893 .
1) In Codeunit1, function OnDatabaseModify, I put a breakpoint here.
2) Then I turn on the debugger
3) When I modify a record SalesLine table (Modified from table directly, not from Page), the debugger breaks on the OnDatabaseModify function
GREAT!!!
4) However when I modify a record in PurchseLine table (Modified from table directly, not from Page), the debugger DOES NOT break on the OnDatabaseModify function
NOT GREAT!!!
Why is it that changes in PurchaseLine table does not trigger OnDatabaseModify trigger?
I have also tested with other table such as Customer, Payment Terms, currency, and these tables fire the OnDatabaseModify function. But this does not seem to work on PurchaseLine.
Jordi
0
Comments
-
You're probably facing a weird bug.
Try to close the debugger and development environment, open it again and re-do your test.
The OnDatabaseModify trigger should run whenever there is a change to any record.0 -
I tested in 2 different version (NAV2017 and NAV2018), and the outcome is the same.
However, there is a workaround. Turn on change log for PurchLine table, and the OnDatabaseModify trigger will fire.0 -
I tested in 2 different version (NAV2017 and NAV2018), and the outcome is the same.
However, there is a workaround. Turn on change log for PurchLine table, and the OnDatabaseModify trigger will fire.
It'll fire but you validated that it didn't just fire because of the Change Log record?0 -
You first need to enable the database trigger by running function "GetDatabaseTableTriggerSetup" and telling the system that T39 should be enabled.
This function will ONLY run once per session when the table is first accessed. So once you have the code in place that calls the function "GetDatabaseTableTriggerSetup", you need to restart your client.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!2 -
You first need to enable the database trigger by running function "GetDatabaseTableTriggerSetup" and telling the system that T39 should be enabled.
This function will ONLY run once per session when the table is first accessed. So once you have the code in place that calls the function "GetDatabaseTableTriggerSetup", you need to restart your client.
@kriki is right. I was wrong, the OnDatabaseModify trigger does not run in every single record, it only runs on the ones that are defined like @kriki said.
I suggest you to read this article, and focus on deV.ch's answer: https://forum.mibuso.com/discussion/59929/cu-1-ondatabase-methods0 -
You first need to enable the database trigger by running function "GetDatabaseTableTriggerSetup" and telling the system that T39 should be enabled.
This function will ONLY run once per session when the table is first accessed. So once you have the code in place that calls the function "GetDatabaseTableTriggerSetup", you need to restart your client.
This the solution. You either modify this function to include the table you want to fire Database triggers, or just simple enable it in changelog.
Thanks.0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
