Difference between client script and business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2017 11:14 PM
Hi,
What is the difference between client script and business rule apart from the one that client script runs on the form and business rules on the database. Suppose I have a business rule which prints a message when one field in the form is empty and I have a client script that does the same thing. How do I come to know whether it is the Business rule or the client script that worked.
Thanks in advance
Sruthi

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2017 11:18 PM
Hello Sruthi,
If the message is displayed during form load or on change of any field then it is a client-side operation or can be a Display BR. However, if the message is shown after the form is submitted then it can be onSubmit client script or business rule.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2017 11:22 PM
Hi Sruthi,
client script executed on client browser, it included onload, onsubmit, onchange, oncellEdit.
Business rule is server side scripting used to perform the operation on server, its having the types 1)before 2) after
executed at the time of 1) display or query 2) insert 3) update 4)delete
@serch with wiki on more, if you need any help ask me
Regards
Venkat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-24-2017 11:23 PM
Hello Sruthi,
I hope this helpful to you,
The major difference between of them client script always runs on clisnt side browser and Business Rule always runs on server side when a record inserted/updated/deleted/queried from data base.
Client-based code:
"Client-based code that executes in the browser, using Ajax or running as Javascript, always executes before the form submission to the server."
This includes Client scripts and UI Policies.
First onLoad Client scripts, after that the first UI Policies kick in.
After that, the Client scripts and UI Policies that work onChange.
After that, the Client scripts that work onSubmit.
Server-side code: (More info: Execution Order of Scripts and Engines)
- Before business rules:
- Before engines.
- Before business rules:
- The data base operation (insert, update, delete).
- After business rules:
- After engines.
- Email notifications.
- After business rules.
Similarities
Most scripts have a name and specify a table.
1.2 Important Differences
The most important differences among scripts are
- the function of the script (what it is used for) and
- whether the script runs on the client or server.
1.3 Client vs. Server
The web browser is the client, and is often the only software that is installed at the customer site.The application server and the database are located at the data center.
- Client scripts run on the client (which is the web browser)
- Server scripts run on the server (which includes the application server and the database)
The web browser is where you control and communicate with an instance, including communicating with the server and database.
![]() | Note: When you are writing scripts, you cannot use reserved words. |
Scripts - Their Functions and Where They Run
Choose the module name for further information.
Script | Function | Runs on |
http://wiki.servicenow.com/index.php?title=Using_Access_Control_Rules | ||
Business Rules | Customizes system behavior
| server - script and any condition run on the server |
Client Scripts | Used for making changes to the appearance of forms, displaying different fields based on values that are entered or other custom display options.
| client |
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
‎09-24-2017 11:27 PM
now coming to your questions,
business rule which prints a message when one field in the form is empty and I have a client script that does the same thing. How do I come to know whether it is the Business rule or the client script that worked.
Ans : The server side query or display business rule runs first. That is during load of the record from the server side. Then client side scripts will pick up. Then, before and after business rules.
Thanks,
Rajashekhar Mushke
Rising star : 2022 - 2024
Community Leader -2018
Connect me on LinkedIn : Rajashekhar Mushke