web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Notify about AIF errors / failure via email

(0) ShareShare
ReportReport
Posted on by

Hi guys,

Basically, what we are trying to achieve is to receive notifications for failed AIF processing. So if there is an error let's say within the XML document and a corresponding entry is created in the Queue manager as status Error, then we should get an email notification.

I assumed that the actual AIF processing classes will "report back" the errors to the batch job and we will get the alert via batch job. But it looks like even when you have an entry in the Queue manager with "Error", the corresponding batch job is still "Ended".

I also tried to set up the change based alert directly on the Queue manager table for new records with specific status, but it doesn't seem to work either.

The alerts and email notifications for other tables (or other batch jobs) do work.

Any ideas?
Is it because the AIF processing classes simply catch and "mute" the errors?

_____________
Update 1:
I tried the workaround where I created an alert rule on the table System administration > Periodic > Services and AIF > Exceptions to alert about all created records. After that, I can see records in the table EventCUD related to the Exceptions table (SysExceptionTable, ID 1359), but it looks like the Alerts batch job is not picking them up. The field BatchId remains {00000000-0000-0000-0000-000000000000} for all records. It does pick up events from other changed records (like Customer for example).

Thanks a lot!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    299,397 Super User 2025 Season 2 on at
    RE: Set batch jobs for AIF as "Error" when queue manager has errors

    Hi Waldemar,

    The AIF processing indeed continues on failed messages as the error will be visible in AIF. As one batch run can pick up multiple messages from several AIF services, this is intended.

    So the alerting on errors is not possible for AIF using the batch jobs.

    You can use the options in the Periodic System administration menu related to AIF.

  • Community Member Profile Picture
    on at
    RE: Set batch jobs for AIF as "Error" when queue manager has errors

    André, thanks for the speedy response.

    I kind of suspected that.

    As a potential workaround, in System administration > Periodic > Services and AIF > Queue manager I have created an alert (Right click on a record > Create alert rule...) to raise an alert for new records in status "Error". And later without any specific status, just for all new records (to test it).

    It doesn't work. Setting the alert rules for other records (like Customer) does work.

    So I wondered if AIF is creating the records in the Queue manager in some special way, so the Alert rules don't trigger.

    In general, how do you monitor AIF errors? Or is there no way to get emails for failed AIF messages without customizing?

    Thanks,

    Waldemar

  • Community Member Profile Picture
    on at
    RE: Notify about AIF errors / failure via email

    Hi Waldemar, Even I have got the same requirement over here.

    Can you send me the code which you used to trigger email whenever there is an exception?

  • Mariano Gracia Profile Picture
    on at
    RE: Notify about AIF errors / failure via email

    Ooops, didn't saw you have already tried it from the AIF queue messages, I have tried to delete my post but I can't and don't know why

    You could create an alert rule for the AIF exception table (System administration\Daily\AIF\Exceptions), so each time a record is inserted there you can send an alert, but be aware that a single AIF message can create multiple registers, for example, a sales order with invalid customer and item will throw two messages.

  • Martin Dráb Profile Picture
    236,353 Most Valuable Professional on at
    RE: Notify about AIF errors / failure via email

    It's some time since Waldemar asked his questions, nevertheless I'll address it here for others' benefit...

    Queue manager displays data from two different queues and the data source, AifOutboundProcessingQueue table, is dropped and filled again every time somebody opens or refreshes the form. It's clearly not a good candidate for alerts.

    You could try your luck with the underlying queues (AifGatewayQueue and AifOutboundProcessingQueue), although if I was you, I would do it as a customization (with configuration at endpoint).

    Also don't forget that AIF supports response messages.

  • Community Member Profile Picture
    on at
    RE: Notify about AIF errors / failure via email

    Dear Martin,

    Thanks for the reply.

    My scenario here is I need to send as an email only when one of the exception fails.

    I have seen a class sysmailer.quicksend. will that help? can you please provide me the code where I should place such that both exception goes to the exception form and mail gets triggered at the same time?

  • Martin Dráb Profile Picture
    236,353 Most Valuable Professional on at
    RE: Notify about AIF errors / failure via email

    I can't write the code for you even if I wanted, because I don't know your exact requirements, nevertheless note that the exceptions are logged by SysExceptionLog class. Use it as the starting point and then use your knowledge about your requirements to implement whatever you need.

  • Community Member Profile Picture
    on at
    RE: Notify about AIF errors / failure via email

    Hi Martin , basically below is my requirement :

    1. Compare the pallet ID in incoming XML to “InventLocationType” field in the “InventLocation” Table in AX. If the pallet ID from incoming XML matches the quarantine pallet ID that exist in AX:

    1.1. Place an error so the error is recorded on the AIF message queue and files reject .

    1.2. Send email alert to the email distribution list

    The email should contain: Sales Order number, Pallet ID, Customer Ship To Address and Time of shipment.

    I have done till point 1.1 - validation is working perfectly. Now I will have to do point 1.2 . your inputs here would benefit me a lot here to solve my issue.

    many thanks in advance !

    Regards

    Ankush

  • Martin Dráb Profile Picture
    236,353 Most Valuable Professional on at
    RE: Notify about AIF errors / failure via email

    Either send an e-mail and then throw an exception, or put all details into error message, throw an exception and then implement some generic error notifications. It all depends on the required behavior.

  • Community Member Profile Picture
    on at
    RE: Notify about AIF errors / failure via email

    Just a few thoughts.

    I would try to go with response messages (part of individual ports / interfaces logic), so the external system can also interpret and potentially react to these error messages.

    I try to avoid using central framework objects. Maybe use an event handler on one of the AIF queue tables.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Tocauer Profile Picture

Martin Tocauer 4

#1
Community Member Profile Picture

Community Member 4

#3
Nayyar Siddiqi Profile Picture

Nayyar Siddiqi 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans