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 run a onLoad client script on all extended task table forms ?

EdwinRandall
Tera Contributor

 

function onLoad() {
   // Help with service offering
   var tableName = g_form.getTableName();
   var message = "select to choose the correct Service offering.";
   
   if (tableName === 'sc_req_item' || tableName === 'incident' && g_form.isVisible('service_offering')) {
      g_form.showFieldMsg('service_offering', message, 'info');
   }
}
2 ACCEPTED SOLUTIONS

Sandeep Rajput
Tera Patron
Tera Patron

@EdwinRandall On your client script form, check the Inherited checkbox and the script will be applied to all the extended tables.

 

Screenshot 2025-04-18 at 5.57.37 AM.png

Hope this helps.

View solution in original post

Ankur Bawiskar
Tera Patron
Tera Patron

@EdwinRandall

I agree with Sandeep here.

You can use that inherited checkbox

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@EdwinRandall On your client script form, check the Inherited checkbox and the script will be applied to all the extended tables.

 

Screenshot 2025-04-18 at 5.57.37 AM.png

Hope this helps.

Ankur Bawiskar
Tera Patron
Tera Patron

@EdwinRandall

I agree with Sandeep here.

You can use that inherited checkbox

If my response helped please mark it correct and close the thread so that it benefits future readers.

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