Improving gs.addInfoMessage with gs.getMessage

old script:

gs.addInfoMessage("The number " + current.number + " was already used by another " + recordClass + ". The " + recordClass + " number has been changed to " + newNum);



improved script:

var sFeedback = gs.getMessage("The number {0} was already used by another {1}. The {1} number has been changed to {2}", [ current.number, recordClass, newNum ]);

gs.addInfoMessage(sFeedback);

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

URL link in addInfoMessage