What is the Difference between Display BR and onLoad client script other than one is server side script and another is client side
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2021 11:30 AM
Difference between Display BR and onLoad client script with demo in personal instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2021 11:39 AM
The primary difference is that a display business rule can save something to the scratchpad that isn't available in a client script running on that record.
One example is to get the value of a record field that isn't displayed on the form.
Save it to the scratchpad:
g_scratchpad.u_priority_status = current.u_priority_status;
Read it in a client script:
if (g_scratchpad.u_priority_status == "urgent") {
// do something here
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2021 11:47 AM
Hello,
It's unfortunate that you chose to delete your post after I provided a response as well as reference several pieces of documentation...only to post your question again.
But...I'll copy and paste this as needed:
Please take a moment and search the documentation yourself and then let us know what questions you may have:
Display BR: https://docs.servicenow.com/bundle/paris-application-development/page/script/business-rules/concept/...
Client Script: https://docs.servicenow.com/bundle/quebec-application-development/page/script/client-scripts/concept...
Display BR allows you to set scratchpad that you can use to bring server information directly in to the record onLoad.
onLoad client script is client side scripting and it's still needed to utilize the scratchpad brought from the display BR anyway.
So they're still connected in that way.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!