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
Ron
0
Answers
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
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
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=1101