Message::AddAction() – This is how it rolls in MSDyn365FO version 10.0.10 PU34

In this post I want to highlight a feature which is coming back to Microsoft Dynamics 365 for Finance and Operation in version 10.0.10 PU34. In older days of MSDyn365FO it was possible to link infolog messages to a menu item including a record to display. This feature was gone since Microsoft moved the whole application to the cloud with version 7. With version 10.0.10 PU33 this feature is coming back as you can read  here: https://docs.microsoft.com/en-gb/dynamics365/fin-ops-core/dev-itpro/user-interface/messaging-api-center-bar-details#message

How the message looks when you use the following code, you can see in the banner of the post:

    CustTable custTable = CustTable::find('US-003');
    
    MenuItemMessageAction actionData = new MenuItemMessageAction();
    actionData.MenuItemName(menuItemDisplayStr(CustTable));
    actionData.TableName(tableStr(CustTable));
    actionData.RecId(custTable.RecId);
    str jsonData = FormJsonSerializer::serializeClass(actionData);

    int64 messageId = Message::AddAction(MessageSeverity::Informational, 
        "@SYS117450",
        custTable.name(), MessageActionType::DisplayMenuItem, jsonData);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s