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 add "Error message " in API

Sruthi_2511
Tera Contributor

Here is the requirement to add error message for "Change Registration" Modal.  (which is used by API users) alone

Example:

Close code: Successful

State: Cancel (4 )----error message should be shown in API users alone not in UI

 

 

 

2 REPLIES 2

palanikumar
Giga Sage
Giga Sage

Hi @Sruthi_2511 ,

Can you tell me how are you calling this? 

gs.addErrorMessage will display error in UI and gs.error will add to the log.

If you want this to be returned to API, then this should be stored in a field so that API can return error message.

 

Thank you,
Palani

Ankur Bawiskar
Tera Patron
Tera Patron

@Sruthi_2511 

seems a duplicate question you already raised where I responded

How to add "Error message " in API Call 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader