Difference between script include and BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:48 PM
Difference between script include and BR
- 10,607 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:50 PM
Hello Jai,
Script Include:
Create script includes to store JavaScript functions and classes for use by server scripts. Each script include defines either an object class or a function. Script includes run only when called by a server script.
Script Includes - ServiceNow Wiki
Business rule:
A business rule is a server-side script that runs when a record is displayed, inserted, updated, deleted, or when a table is queried. A typical business rule might execute a script after a user updates an incident or escalates the priority of a change request.
Business Rules - ServiceNow Wiki
ServiceNow Commnunity MVP -2018 class.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:55 PM
Script Includes exist primarily to re-use business logic code.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2017 11:55 PM
Hello Jai,
Script includes
Script includes are used to store JavaScript that runs on the server.
Create script includes to store JavaScript functions and classes for use by server scripts. Each script include defines either an object class or a function.
Consider using script includes instead of global business rules because script includes are only loaded on request.
- Script include formScript includes have a name, description and script. They also specify whether they are active or not, and whether they can be called from a client script.
- Use script includesScript includes are found under System Definition or System UI. You can call existing script includes from a script.
- Privacy settingsThe privacy setting for a client-callable script-include can be public or private.
- Change privacy on all client-callable script includesHow to change the privacy on all client-callable script includes.
- Change privacy on a single client callable script includeChange the privacy setting for a single client-callable script-include by adding the isPublic() function.
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2017 12:25 AM
Business Rule is something you want to run when anything will happen before/after database update/insert for that record, definitely there are other options as well (like display and query business rule) etc.
Script Include is like re-usable function, in simple example if you want to calculate the date different of two date fields from incident form or change form then you can have 1 script include and can have a GlideAjax from client scripting to re-use them for both the places.