Client Scripts and and overriding parent table

Chris McDevitt
ServiceNow Employee
ServiceNow Employee

Hey coders,

Use case:

1. The client wants the location set differently for SIR then the OOB Client Scripts that are inherited from Service Order.

2. I would like to minimize the changes to the OOB Client Scripts. (i.e. not change the OOB scripts if possible)

3. I would like to preserve the OOB functionality. 

- I do realize I could uncheck Inherited, but what if other tables wanted to use these inherited scripts?

- I do realize I could copy the OOB scripts then test for the table I am on and apply custom logic... but that seems like a brute force approach. 

Is it possible to "override"  or not inherit the client scripts?

Thanks in advance for your help,

-Chris

find_real_file.png

1 REPLY 1

Abhinay Erra
Giga Sage

I do not see any other way other than making a copy of the OOB client script. deactivate the OOB. And in the custom one add an if condition to check for the table name. Something like this

 

if(g_form.getTableName()!='sn_si_incident'){

//put the logic here

}