MessageList
You can use the MessageList function to display messages to the current user in an Alert Message dialog. You can display the message automatically during a workflow event, trigger it through a button event. You can:
- Show a message to the current user.
- Open automatically by inserting in workflow events such as START.
- Can be button-prompted by inserting into a buttoned event.
- Use during configuration as a diagnostic tool
When to use
You can use this function to:
- Inform users about script completion, approval status, or action results.
- Display error messages or warnings when validation fails or data is incorrect.
- Display calculated values, status information, or other dynamic content.
- When creating new formulas during Ingredient Replace,
MessageListsends failure text to the Comment column in the Results table if paired with a 911 return code.
When not to use
- You cannot use this function for logging.
Note: You can use
AddTraceLogfor audit trails, or debugging logs. - You cannot use this function to display language-specific messages unless stored Message Codes and the
GetMessageText()function are used. - You cannot use this function in workflows triggered during import.
Note: Use
AddTraceLongfunction.
Syntax
long MessageList(string msg); long MessageList(string msg, params string[] @params);
How the second method works?
The second method concatenates the text from the @params argument with the msg value.
- No spaces or separators are added between the concatenated values.
- Concatenated text is appended to the msg value
- The function then forwards the combined message to the first method.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| msg | string | Yes | The message text to display to the user |
| @params | String[] | No | The additional string arguments to concatenate to the message (no spaces or separators added). |
Return Value
The application displays a dialog to the user.
Prerequisites
No documented message length limit is available. Keep messages reasonably short.
Examples
- Example 1
-
Simple Message
MessageList("The Approve event completed successfully.");
- Example 2
-
Message with Multiple Arguments.
string[] msgArgs = new string[] { "Argument 1", "Argument 2", "Argument N" }; MessageList("The list of arguments: ", msgArgs);
- Description
- This example outputs the list of arguments such as Argument 1Argument 2 Argument N to the user. Note the lack of space between the argument values.
- Example 3
-
Dynamic Message with Values
string itemCode = "ITEM-001"; string status = "Approved"; MessageList($"Item {itemCode} has been {status}.");
- Example 4
-
Displaying Variable assignments.
object oStatus = ObjProperty("STATUSIND.STATUS"); MessageList("The status is: " + (oStatus ?? "").ToString());
- Description
- This example includes information that is assigned to the local variables in the alert message. This example shows the status of the object of the workflow in the alert message box.
- Example 5
-
Applying font styles to messages.
MessageList(βThe status value is {b}β, iStatus.ToString(), β{/b}!β);
- Description
- This example includes basic HTML text formatting in the message. Note that curly brackets {b} must be used instead of standard html <b> for security purposes.