|
Creating Custom Messages
You can create custom messages to be displayed when custom validation rules are applied. Messages can include message arguments that display values contained in attributes from a context object. For example, to insert an employee’s name into the message, create a message argument that references the Employee name attribute from an employee.If you have created a custom Indicator class and added a relationship that supports mass updates, you must also create an informational message on the related custom class. The message displays the value that will appear in the Values to Copy window of the Indicator Mass Update wizard. Use one or more message arguments to substitute the data from the related class. For example, the Indicator class’ Owns Many relationship with the Calculation Input class uses the message 22 - &1 - &2 (&3). This informational message is on the Calculation Input class. The message arguments reference the Input Name (&1), Input Description (&2), and Input Type (&3). In the Indicator Mass Update wizard, the value to be copied might appear as “Input1 - Last Reading of Indicator A (Based on readings)”.You can create custom messages on the States and Validation view of a custom class, or while creating the validation rule. This topic explains how to create a message from the States and Validation view.To Create a Custom Message
1. Open the custom class and select the States and Validation view.
2.
3. The system enters a default Message number, which you can change, if necessary.
4. Select a Message type:
• Error: the field being validated is red-lined when the rule is violated. The error message is displayed if the user tries to save or close the object. The user is prevented from performing the action until the error condition is corrected.
• Warning: the field being validated is yellow-lined when the rule is violated. The warning message is displayed if the user tries to save or close the object. Warning messages provide Yes and No buttons, allowing the user to continue or to cancel the action.
• Information: The system displays the information message when the rule is violated. The user can review the message and continue normally.To create a message argument, click New. The Message Argument dialog appears.
Select Parent class to use an attribute from the class that you are customizing or from a related class. This is the option that you will use in most cases.If you are creating the message from a class that is an argument object without a relationship to the originating class (the class from which the method is run that calls the argument object), select the Context class option. You can then select the Context object from which you need to select an attribute or relationship.
8. Click OK to save the argument.
9.
11.