What is the difference between getMessage() and getMessages() in ServiceNow?

AzeemullahA
Giga Contributor

I am confused between getMessage() and getMessages() in ServiceNow.
Both are used to fetch localized messages from the System Message table, but I want to understand the exact difference and when to use each one.

Can someone briefly explain this with a simple example?

1 REPLY 1

Brian Lancaster
Kilo Patron

I just looked on the Developer site and compared the description of each one. The only difference I found was for getMessages it also had "Useful if you are inserting into a JavaScript expression from Jelly." So it seems like getMessages is to be used on UI Macros and UI Pages where you use Jelly script while getMessage is for things like business rule etc.