- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2020 08:35 AM
We can call business rules in Client Scripts, if we call BR Please tell me which scenarios we can Call?
Please provide any examples.
Note: We Can Call Client Scripts in Business Rules.(Please provide any examples, If Yes)
Thanks
Ram
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2020 09:22 AM
Basically both are different.
There are not many actual real-time scenarios wherein you required calling business rule from client script
and is not recommended best practice.
Client Script - they run when form is loaded and run on UI i.e. frontend
Business Rule - they run when form is submitted i.e. any database transaction happens such as insert/update/delete and is server side
Please find the below responses:
1) Call Client Script in Business Rule - not possible
2) Call business rule from Client Script - Use Script includes instead of global business rules
Do not create a business rule, but instead navigate to System Definition > Script Include and create a new script
Advantage of using Script Include over Global Business rule:
1) You can have re-usable function which can be called from multiple server side scripts such as workflow run script, other business rule, other script include, schedule job etc
Use Script Includes Instead of Global Business Rules
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2020 08:42 AM
You need to create Global Business rule and the you can call it anywhere but that is not recommended and have adverse effects. Instead we use script includes to process server side data and call it from Client script using GlideAjax.
Please refer
Glide AJAX DOCS
Use Script Includes Instead of Global Business Rules
Thanks & Regards,
Sharjeel
Muhammad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2020 09:22 AM
Basically both are different.
There are not many actual real-time scenarios wherein you required calling business rule from client script
and is not recommended best practice.
Client Script - they run when form is loaded and run on UI i.e. frontend
Business Rule - they run when form is submitted i.e. any database transaction happens such as insert/update/delete and is server side
Please find the below responses:
1) Call Client Script in Business Rule - not possible
2) Call business rule from Client Script - Use Script includes instead of global business rules
Do not create a business rule, but instead navigate to System Definition > Script Include and create a new script
Advantage of using Script Include over Global Business rule:
1) You can have re-usable function which can be called from multiple server side scripts such as workflow run script, other business rule, other script include, schedule job etc
Use Script Includes Instead of Global Business Rules
Regards
Ankur
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-25-2020 10:02 AM
Just to Add on to above answers,
1) we do have a field called "Client Callable" still on the BR from, and if you filter the BR records you can find many BR's with this box checked.
2) These are the server scripts, that run on Global table, and in olden days where there was a no concept of Script Include, developers use to create a BR on global table and make a ajax call to call this script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā12-20-2020 12:34 AM
Check out this video, it will clear all your doubts and help you to understand Business Rule queries in details.
Link: https://www.youtube.com/watch?v=hLottNnk21U&ab_channel=ServiceNowHelpdesk
It help you to understand below points.
- Scenario based business rule uses
- Best business use cases for all types of business rules
- Current .update in before business rule
- Difference between Before BR and Before query BR?
- Where can we use query business rule?
- All type of business rule with real world scenario
- Before
- After
- Async
- Display
Please mark reply as Helpful/Correct, if applicable. Thanks!!