Message::AddAction() method can be used to embed an action within a message sent to the message bar. This method supports adding a single action that is associated with a display or action menu item, which is then visualized as a link button, redirecting users directly to the form with the correct record selected. Here's how it can be used.
public static void pushNotification(str NotificationMsg, str actionText,LedgerJournalTable journalTable) { MenuItemMessageAction actionData = new MenuItemMessageAction(); actionData.MenuItemName(menuItemDisplayStr(LedgerJournalTable)); actionData.TableName(tableStr(LedgerJournalTable)); actionData.RecId(journalTable.RecId); str jsonData = FormJsonSerializer::serializeClass(actionData); int64 messageId = Message::AddAction(MessageSeverity::Informational,NotificationMsg ,actionText, MessageActionType::DisplayMenuItem, jsonData); }Muhammad Aamir Hanif Reference
No comments:
Post a Comment