Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to override setAbortAction() Message

HarshTimes
Tera Guru

Can anyone tell me How to override setAbortAction() Message?

Thanks
Harsh

3 REPLIES 3

ssb
Tera Guru

There's some tips here: current.setAbortAction(true) causes the error message 'Invalid update'

"Also forgot to mention that it can be updated via System UI -> Messages (key 'Invalid update'), to be at least a little more user friendly."

And IMHO ("Servicenow Guru" agrees) that you should probably add another info message that explains _why_ the action was aborted.

http://www.servicenowguru.com/scripting/stopping-record-submission-servicenow/


I have set a field as unique.So when i try to create a duplicate record system shows an error message.Can we override that message


That message doesn't seem to come from a (System UI) Message. My first reaction would be, no, you can't.
But you could build something to detect the unique key violation _before_ ServiceNow picks it up and throws that error.