ADisplay Business Ruleis aserver-side scriptin ServiceNow thatruns before the form is displayed to the user.
Populatesg_scratchpad(Shared Data Object)
g_scratchpadis atemporary objectthat storesserver-side dataand makes it available toclient-side scripts (e.g., Client Scripts, UI Policies).
Example: If you need topass user-specific information(e.g., "Manager Name" or "User Role") from the server to the client, you useg_scratchpad.
Runs Before the Form Loads
Executesbefore data is sent to the client, ensuring thatpreprocessed datais available.
Improves performanceby reducing unnecessary server calls.
Does Not Modify Records Directly
Unlike other Business Rules (Before,After,Async),Display rules do not modify the recordbeing loaded.
They only preparedata for the client-side.
Primary Purpose of a Display Business Rule:
Example of a Display Business Rule:// Runs before the form loads
(functionexecuteRule(current, gScratchpad) {
gScratchpad.manager_name= current.manager.getDisplayValue();
})(current, gScratchpad);
This scriptretrieves the manager’s namefrom the server andmakes it available on the client-sideusingg_scratchpad.manager_name.
AClient Scriptcan then useg_scratchpad.manager_nameto display the manager’s name in a fieldwithout making another server call.
A. To monitor fields on a form, and provide feedbackIncorrect– This describesClient Scripts and UI Policies, not Display Business Rules.
C. To set fields to mandatory, hidden, and read-onlyIncorrect– These actions arehandled by UI Policies or Client Scripts, not Display Business Rules.
D. To define what happens on a form when a particular field changesIncorrect– This is the function of anOnChange Client Script, not a Display Business Rule.
Incorrect Answer Choices Analysis:
ServiceNow Docs – Business Rules Overview????Display Business Rules
ServiceNow Docs – g_scratchpad Usage????Using g_scratchpad in Display Business Rules
Official ServiceNow Documentation References: