Your alert rules stopped working all of a sudden? Chances are you’ve modified your database log setup and thereby killed the alerts.
What? Why? But how?
(Add the end of this post, you’ll find an X++ job that will revive your alerts)
(Edit, Dec. 16, 2015: Applies to R2, R3 fix is identical to „my“ solution!)
OK, here’s how (I leave the why to somebody else):
- Background Information:
- Alerts use the same setup table as the database log (System Documentation > tables > DatabaseLog)
- The Setup records only differ in the field logType and use Insert Alert, Update Alert etc. instead of simply Insert, Update …
- When you open the database log setup wizard, it will copy the database log setup to a temporary table and show it in the form.
- The user clicks through the wizard’s tab pages and closes it with the button „Finish“ …
- And now, the wizard will delete ALL records in the Setup table, and reconstruct those that are relevant to the database log Setup. Which records with logType Insert Alert etc. are not.
- So, now they’re gone. Voilà.
The entire wizard, both form and class, would benefit from a major refactoring. But this is beyond the scope of this blog post and for now, I’ll just do a quick fix. It’s not nice, but its not worse than the code we already see:
As you can imagine: No warranties – use both the fix and the job at your own risk!