Broken Alerts? Bad Wizard!

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!)

001 WizardNo

OK, here’s how (I leave the why to somebody else):

  1. 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
  2. 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.
  3. The user clicks through the wizard’s tab pages and closes it with the button „Finish“ …
  4. 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.
  5. 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:
002 FixWizardClass

And here is the promised Job for recreating the deleted setup records:
003 RecreateJob

As you can imagine: No warranties – use both the fix and the job at your own risk!

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.