How to modify oob script include

anilkumarsharma
Giga Guru

Hello Team,

How can I modify the OOB script include if required?

what is the best way to implement the requirement without touch oob script include?

 

Regards

Anil Sharma

 

 

3 REPLIES 3

Naga Ravindra R
Kilo Sage

Hi @anilkumarsharma 

 

As it is not recommended to modify the OOB script include, instead you can do a Insert and stay and add one more reusable function inside it. (for you logic).

 

Please mark as helpful/correct. if it helps.

Vijay kumar S1
Tera Expert

Hi Anil,

 

Modifying out-of-the-box (OOB) script includes can be  very risky, as it can impact system functionality and may be overwritten when upgrading or patching ServiceNow.

To modify an OOB script include without touching the original OOB file, you can create a new script include that extends the OOB script include and overrides the functions or properties that need to be modified.

Here are the steps to create a new script include that extends an OOB script include:

  1. Navigate to "System Definition" > "Script Includes" in the ServiceNow navigation menu.
  2. Click the "New" button to create a new script include.
  3. Enter a name for the new script include, and choose the "Extends" checkbox.
  4. Select the OOB script include that you want to extend from the "Extends Script" dropdown.
  5. Override the functions or properties that need to be modified in the "Script" section of the new script include.
  6. Save the new script include.

In your code, instead of using the OOB script include, use your custom script include that extends the OOB script include. The system will use your custom script include instead of the OOB script include, and the modifications you made in the custom script include will be applied.

 

Please mark helpful or correct if its helping 

Thank you 

Vijay

Thanks Vijay but How can i Override the functions or properties? Please share one example.