Field Rename will break Event Triggers

Events are well known in the NAV world today. Everybody is using this very nice feature. Not!?
No more table modifications for validations or extra features when inserting records. Only but advantages from my opinion. But recently I ran into an issue.

I have created a new table with some fields.
Then I created a hook codeunit with 2 functions based on the “OnAfterValidateEvent” trigger.
Nothing special.

After everything was tested, the consultant or customer asked me to change the name of some fields. Not just the captions but also the name.
So as ask, I did the changes and compiled everything without an error. Where the fields were used on pages or in CAL everything was updated with the new field name. And it seems that it would work.

But after testing the solution again we ran into some issues. The validations of the fields were gone and no triggers were fired.
And after some investigation I found the problem in the “Event Subscription” page.

Continue reading