Usage of Display business rule with Client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 04:18 AM
Hi,
Can Display business rule be used alone or it has to be used always with g_scratchpad variable in it and corresponding onLoad client script to call the scratchpad variable?
can you help here?
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 04:24 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 04:25 AM
Hi Rama,
Display Business Rules execute their logic when a form loads and a record is loaded from the database. They must complete execution before control of the form is given to a user. The purpose of a display Business Rule is to populate an automatically instantiated object, g_scratchpad. The g_scratchpad object is passed from the display Business Rule to the client-side for use by client-side scripts. Recall that when scripting on the client-side, scripts only have access to fields and field values for fields on the form and not all of the fields from the database. Use the g_scratchpad object to pass data to the client-side without modifying the form. The g_scratchpad object has no default properties.
Below links will help you to understand more!!
example use of display business rule
Hope it helps!!
Regards,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 04:27 AM
Yes,Display business rule can be used alone too. The value of variables get stored into scratchpad which you can store that into another variables.
For further info I am sharing the link:Using the Workflow Scratchpad - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-24-2017 04:32 AM
Hi Shashasnk,
The business rule storing any variable is of no use until its called by an client script. So, what would be the point of using the g_scratchpad in BR if its not utilized.
Regards,
Shariq