NAV2016 events don't fire after compiling a related object
rsaritzky
Member Posts: 469
Hi all,
We have NAV2016 CU5, and use Chargelogic's shipping addon, which uses event subscriptions. They have a codeunit that their events are located in.
We also have events that subscribe to the same objects. Our event code is in a separate codeunit.
We have encountered a situation where when a related object is replaced in the database and compiled, the link to the events "breaks" and the events don't fire.
Example:
We have defined a series of "hooks" to isolate our code in Table 36. All we have in the table are calls to the hooks in the separate codeunit
We also have events based on standard events defined in Table 36.
Let's say we make a change to, say to the Item table, which is referenced in Table 37. When we replace Table Object 27 in the database, the events in Table 36 stop firing.
If we recompile our event codeunits, things start working again.
Has anyone encountered something similar?
Thanks
Ron
We have NAV2016 CU5, and use Chargelogic's shipping addon, which uses event subscriptions. They have a codeunit that their events are located in.
We also have events that subscribe to the same objects. Our event code is in a separate codeunit.
We have encountered a situation where when a related object is replaced in the database and compiled, the link to the events "breaks" and the events don't fire.
Example:
We have defined a series of "hooks" to isolate our code in Table 36. All we have in the table are calls to the hooks in the separate codeunit
We also have events based on standard events defined in Table 36.
Let's say we make a change to, say to the Item table, which is referenced in Table 37. When we replace Table Object 27 in the database, the events in Table 36 stop firing.
If we recompile our event codeunits, things start working again.
Has anyone encountered something similar?
Thanks
Ron
Ron
0
Best Answer
-
Sure. I've seen it.
It was fixed in NAV 2017 CU4 / NAV 2016 CU16.
Bug ID: 203304 - Events stop being triggered after compiling other objects
I've blogged about it here (unfortunately in Danish): http://blog.systemconnect.dk/?p=11011
Answers
-
Hi,
No, I did not.
But thinking of the problem it kind of makes sense. I'd say that Subscribers are supposed to bind to existing publishers, not the other way around.
This is just my guesswork, but I think that when are replacing the object The the Object Metatada and Object Metatada Snapshot for the publisher changes and the old bindings based on object that has just been replaced are removed. This is seems to be much easier solution to implement than to make a full analysis which publisher has been removed which not, checking if the publisher signatures have changed etc.
Much simpler action is to remove all bindings based on the publisher object ID, and restore/refresh them when subscribers are loaded/updated.
Since the subscribers are supposed to bind to existing publishers in order to re-establish static-automatic bindings in case of publisher change all the codeunits would have to be analyzed. It seems to be easier and quicker solution to analyze just the codeunit which is loaded/compiled. Which of course results in an error you're experiencing - as without compiling codeunits the binding would not be established.
It's probably not very helpful for you, but as far as I remember there was somewhere in the documentation a note about loading fobs, mentioning that after loading a fob the database objects should be recompiled. Perhaps this is the reason why.
Slawek
Slawek Guzek - www.yitron.co.uk
Business Central, MS SQL Server, Wherescape RED;0 -
Sure. I've seen it.
It was fixed in NAV 2017 CU4 / NAV 2016 CU16.
Bug ID: 203304 - Events stop being triggered after compiling other objects
I've blogged about it here (unfortunately in Danish): http://blog.systemconnect.dk/?p=11011 -
Thank you. This appears to be consistent with our scenario. We are currently on 2016 CU5 and your blog mentioned that this is corrected with CU16. We are planning on upgrading to CU20+ very soon.Ron0
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
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 253 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

