Message API - Message::AddAction() in D365FO Version 10.0.10 PU34 | New Feature - CloudFronts

Message API – Message::AddAction() in D365FO Version 10.0.10 PU34 | New Feature

Introduction: 
From the version 10.0.10 Platform update 34, Microsoft has added a new feature Message::AddAction() which is shown in the message bar. 

Details: 
Message API associated with display or action menu items, which is visualized as a hyperlink/link button. 

It is linked with a single record at a time, called single action. 
In below taken example, we will show sales order is navigated to the form SalesTable from the message bar. 
For testing it, we’ll create the runnable class also know as job in AX 2012. 

class CFSMessageAPI
{
    public static void main(Args _args)
    {
        SalesTable            salesTable = SalesTable::find('SH-000121');
        MenuItemMessageAction actionData = new MenuItemMessageAction();

        actionData.MenuItemName(menuItemDisplayStr(SalesTable));
        actionData.TableName(tableStr(SalesTable));
        actionData.RecId(salesTable.RecId);
        str jsonData = FormJsonSerializer::serializeClass(actionData);

        int64 messageId = Message::AddAction(MessageSeverity::Informational, "Sales order details", salesTable.customerName(), MessageActionType::DisplayMenuItem, jsonData);
    }

}

Let’s see how it works, 

In my case it’s showing Mitchell. Click on the link. 

After clicking on the action link, it is navigated to the sales order record form as shown in the above link. 

Hurray, How pretty feature is released !!!

Conclusion: In above example, we have seen how Message API is routed to the record. 
Thanks for reading !!!


Share Story :

Secured By miniOrange