How to use Message field in Business Rule using script?

salvadormarchan
Kilo Guru

Hi All,

I am trying to use the Message field of Business Rules. I am also activating the 'Abort action' checkbox. So, I believe that when my condition is matched, the BR will abort it and shows my message. My old way (scripts) of displaying messages from a BR is:

gs.addErrorMessage(gs.getMessage("UIM010005",[current.begin, current.end]));

How do I convert this message and apply in the Message field of BRs?

Thanks,

Dor

1 ACCEPTED SOLUTION

I put this script in the Message window pane: gs.getMessage("UIM010005",[current.begin, current.end])


...and the result is NOT the contents of UIM010005 but shows "gs.getMessage("UIM010005",[current.begin, current.end])"



I guess I'll use the old fashion script then.


View solution in original post

2 REPLIES 2

manikorada
ServiceNow Employee

Dor,



The New 'Add Message' works as gs.addInfoMessage() methid. So, if you wish to add error message you need to use the Script section and use gs.addErrorMessage();


I put this script in the Message window pane: gs.getMessage("UIM010005",[current.begin, current.end])


...and the result is NOT the contents of UIM010005 but shows "gs.getMessage("UIM010005",[current.begin, current.end])"



I guess I'll use the old fashion script then.