Trigger that gets also called by simple modify

gin31
Member Posts: 2
Hello.
I'm using NAV in a three company setup and want to sync table data to my other companies. Therefore I've created a simple CU that inserts/updates preselected tables in the other company. I want to call this method everytime when a record in the company was inserted or modified. Therefore I rely on the OnInsert and OnModify trigger of the tables (e.g. Item table). My problem is that there are many code lines (even in the standard NAV Ca/L) that make modifications and inserts without passing TRUE and therefore calling the triggers. I have also tried to use GlobalOnModify in CU 1 with the same results. Is there a way to get notified of all inserts/updates?
I'm using NAV in a three company setup and want to sync table data to my other companies. Therefore I've created a simple CU that inserts/updates preselected tables in the other company. I want to call this method everytime when a record in the company was inserted or modified. Therefore I rely on the OnInsert and OnModify trigger of the tables (e.g. Item table). My problem is that there are many code lines (even in the standard NAV Ca/L) that make modifications and inserts without passing TRUE and therefore calling the triggers. I have also tried to use GlobalOnModify in CU 1 with the same results. Is there a way to get notified of all inserts/updates?
0
Best Answer
-
There are two sets of triggers in Codeunit 1:
OnGlobal... with IDs 20..24
OnDatabase... with IDs 25..29
The former set is called whenever the corresponding table trigger is called also.
The latter set is new with NAV 2009 R2 and is called whenever a corresponding action is carried out on a table.1
Answers
-
Hi,
If you really need to instantly sync the tables as soon as something happens, i think the only real way is a Insert Trigger on the SQL Tables directly. I may be wrong on this though, however preventing a lot of locking may be a challenge.
However if you dont need the data instantly, i would just create a scheduled Report to do the job over night (or be called manually).
regards, wisaAustrian NAV/BC Dev0 -
Yikes, this is what I was afraid of.. Yes, I need the data instantly. I don't really want to put any logic inside a database trigger. Hm, is there a way to call a CU from the database trigger, so that I can handle the logic inside NAV?0
-
There are two sets of triggers in Codeunit 1:
OnGlobal... with IDs 20..24
OnDatabase... with IDs 25..29
The former set is called whenever the corresponding table trigger is called also.
The latter set is new with NAV 2009 R2 and is called whenever a corresponding action is carried out on a table.1
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