Microsoft Dynamics 365 Blog

Recently we recieved an issue where a user managing his Alerts in AX 2012 found, setting a selection of Alerts to “Read” failed to update the UI of the Alert notifications screen properly.

How found:
The user clicked the Alert Bell on the AX Client’s status bar to open Alert Notification form. In the form there where a number of identical of alerts he wanted to mark as “Read”. In the form he selected the records and clicked the “Change status” / “To Read” button in the action pane as in the print screen below

Despite the number of unread Alerts is properly updated at the Alert Bell of the form’s and AX Client’s status bar only the first row In the form has the Bell removed in the Unread Column

 

Solution:
Although using the “Refresh” button will update the screen the problem can be resolved by replacing the reread() method with research() method in the markAlerts method in the “EventAlertInbox” form as in the code below.

void markAlerts(boolean isRead)
{
    EventInbox    inbox;
    EventInbox tmpInbox;

    ;

    for (tmpInbox = getFirstSelection(eventInbox_DS);
          tmpInbox;
          tmpInbox=eventInbox_DS.getNext())
    {
        ttsbegin;

            inbox = EventInbox::find(tmpInbox.InboxId,true);
            inbox.IsRead = isRead;
            inbox.update();
            tmpInbox.reread();

        ttscommit;
    }

//    eventInbox_DS.reread();
    eventInbox_DS.research();

    alertList.arrange();

    infolog.setNumUnreadAlerts(EventInbox::numberOfUnreadAlerts(curuserid()));
}

–author: Jago van der Most
–editor: Jago van der Most
–date: 29/08/2011

We're always looking for feedback and would like to hear from you. Please head to the Dynamics 365 Community to start a discussion, ask questions, and tell us what you think!