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
0
Answers
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 + Page
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 Sinha
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 + Page
Use System Event "OnAfterGetDatabaseTableTriggerSetup" to set parameters.
Thanks Sayan,
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.