With the introduction of NAV2016 we have the possibility to use Eventing with Publisher and Subscriber functions.
A very nice way of making changes without writing any code in the table itself.
But recently I found that the OnAfterValidateEvent don’t work as expected in CU3.
I have made a function and Subscribed to the OnAfterValidateEvent of field “Token” as you can see. With a simple MESSAGE(‘Trigger Fired’) within to test if my function is really executed.
When I test this my trigger isn’t fired and so no message is shown. Oh, no good!!!!!!
First I thought that my subscription wasn’t active.
But when opening the “Event Subscriptions” the new function is there and also active.
After some more research I found that this bug is only related to CU3.
I also found a workaround.
To make the Event trigger work, you need to add some comment line in the OnValidate trigger of the fields on table level.
And then the event will fire and you will receive the message as expected.
This bug is also reported to Microsoft and hopefully will be fixed as soon as possible.
So for now be careful with this type of Event Subscriptions in CU3 and use my workaround.
Or stay at CU2 until this is fixed.