Create a User Defined Error Message which can smartly display dynamic text.
Solution:
- Create a User Defined Error with the text ‘%1 …followed by your text’
- Add the script behind the button where you want to invoke this error from
If(MethodName== “Click”)
{
varMessage= TheApplication().LookupMessage("User Defined Errors","Notification","Fax");
TheApplication().RaiseErrorText(Message);
}
If(MethodName== “Click2”)
{
varMessage= TheApplication().LookupMessage("User Defined Errors","Notification","Letter");
TheApplication().RaiseErrorText(Message);
}
The parameter that is substituted in place of %1 is "Letter" or “Fax”, which is present in the message test