thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Commonly confused · Business Platforms & EA

ServiceNow Business Rule vs Client Script: What's the Difference?

A business rule is server-side JavaScript that runs when a record is displayed, queried, inserted, updated, or deleted, regardless of how the change was made. A client script runs in the user's browser on forms to respond to events like onLoad, onChange, or onSubmit.

Business Rule

Full definition
vs

Client Script

Full definition
Business RuleClient Script
Runs onServerClient browser
TriggerDatabase operations (before, after, async, display)Form events (onLoad, onChange, onSubmit, onCellEdit)
Applies to imports, APIs, integrations?YesNo, only forms in the UI
Typical useSet field values, enforce data logic, create related recordsShow messages, validate input, change field behavior interactively
Key APIscurrent, previous, GlideRecordg_form, g_user, GlideAjax
Performance tipPrefer before rules to avoid extra updatesAvoid synchronous server calls, use GlideAjax async
Remember it

Business rules guard the database; client scripts guide the form.

Exam tip

If logic must apply no matter how a record changes, including web services and imports, choose a business rule. Use display business rules with g_scratchpad to pass server data to client scripts efficiently.

Tested on

More Business Platforms & EA look-alikes