How to use system events of CodeUnit 1.
sunmorningindia
Member Posts: 65
How can I use below system events of CodeUnit 1.
• LOCAL [IntegrationEvent] OnAfterOnGlobalInsert(RecRef : RecordRef)
• LOCAL [IntegrationEvent] OnAfterOnDatabaseInsert(RecRef : RecordRef)
Event “OnAfterOnDatabaseModify” works after setting up the “Integration Service” but not for the OnAfterOnDatabaseInsert. So need help to get the correct steps to configure the system events.
Thanks,
Manish Sinha
• LOCAL [IntegrationEvent] OnAfterOnGlobalInsert(RecRef : RecordRef)
• LOCAL [IntegrationEvent] OnAfterOnDatabaseInsert(RecRef : RecordRef)
Event “OnAfterOnDatabaseModify” works after setting up the “Integration Service” but not for the OnAfterOnDatabaseInsert. So need help to get the correct steps to configure the system events.
Thanks,
Manish Sinha
0
Best Answer
-
Solved.
Use System Event "OnAfterGetDatabaseTableTriggerSetup" to set parameters.
Thanks Sayan,5
Answers
-
Hi,
The OnAfterOnGlobalInsert Event documentation in codeunit 1 Says that this event will only fire if Insert happen Via Pages Only.
Didn't Get Your Question Exactly. Could you please elaborate what exactly you are planning to do?
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
OK Saurav, let me put my word with an example.
Create a new Codeunit and subscribe event as:
Event = Subscriber
EventPublisherObject = Codeunit ApplicationManagement
EventFunction = OnAfterOnDatabaseInsert or OnAfterOnGlobalInsert
Inside that function just message some test, the function will similar to:
LOCAL [EventSubscriber] TestInsertion(RecRef : RecordRef)
MESSAGE('CU50002-OnAfterOnDatabaseInsert for Table %1 %2.',RecRef.NUMBER,RecRef.NAME);
Now create a new Customer from Page, but I didn't get the message from subscribed function.
I am using NAV W1 Build:44365.
Thanks,
Manish Sinha0 -
HI Manish,
Make Sense - OnAfterOnGlobalInsert doesn't seems to be getting fired.
There is no much help available as of now.
But if its related to an upgrade process from NAV 2009 or Before, where old code was placed on OnAfterOnGlobalInsert trigger in codeunit 1, Please move that to OnAfterOnDatabaseInsert.
That is what MSDN Says, Read it here- https://msdn.microsoft.com/en-us/library/hh167300(v=nav.90).aspx
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page0 -
This is a fresh Demo DB with latest build 44365.0
-
Solved.
Use System Event "OnAfterGetDatabaseTableTriggerSetup" to set parameters.
Thanks Sayan,5 -
For anyone else who would run into this issue:
you also need to implement a subscriber function for Publisher "OnAfterGetDatabaseTableTriggerSetup" from Codeunit 1 in which you tell nav for which tableid the events publishers (e.g. OnAfterOnDatabaseInsert) should be executed.0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 329 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
