need to add an error message so it displays on the employee center when i access a certain RITM

Ross Drew
Tera Contributor

I need to add an error message so that it displays on a RITM ticket when accessing it from the employee center. When I use g_form.addErrorMessage() in a Catalog Client Script it works and displays the red error popup message in the native UI, but it does not work when viewing a RITM ticket from the employee center. I have the type on the catalog client script set to 'All' and I have tried just setting the type to Mobile / Service Portal and did not work either. I have tried spUtils.addErrorMessage and that did not work either. Any suggestions?

2 REPLIES 2

Tanushree Maiti
Tera Patron

Hi @Ross Drew 

 

 

  • Open your Catalog Client Script.
  • Ensure Applies on Requested Items is checked.
  • UI type: All
  • Table: sc_req_item
  • Modify your script to use showFieldMsg:
     
    function onLoad() {
           g_form.showFieldMsg('variable_name', 'Your custom error message here.', 'error'); // Replace 'variable_name' with your actual catalog variable
    }

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti

I tried that as well....no luck!