Display Business Rule

Shubham Rai
Tera Contributor

1.     Which of the following objects does a Display Business Rule NOT have access to?

  1. previous
  2. GlideSystem
  3. g_scratchpad
  4. Current.

Please Help me with this question ?

1 ACCEPTED SOLUTION

I did a little test for this to see what is actually happening with previous. 

 

  1. In an incident, I set short_description to "test".
  2. I created a Display BR with this as the action to take:

 

current.setValue('short_description', "THIS IS NOT A DRILL");
current.setValue('description', previous.short_description);

 

  • The results showed that the current value for short_description updated to "THIS IS NOT A DRILL" on display. However, the description field showed the same value rather than "test" which was the original value. So, even though previous exists as an object that "could" be used, it is not correct for Display BRs.
Claude E. D'Amico, III - CSA

View solution in original post

5 REPLIES 5

Claude DAmico
Kilo Sage
  1. Previous - On display, there isn't a previous value. Only current.
  2. GlideSystem - BRs and GlideSystem are server-side so this is fully accessible.
  3. g_scratchpad - BRs are excellent for populating these values to make available for client-side scripts that need a server-side value.
  4. Current - Display will always be able to get current.

https://docs.servicenow.com/bundle/quebec-application-development/page/script/business-rules/concept... 

Claude E. D'Amico, III - CSA

Hi @Claude DAmico ,

Then why we are able to see previous object in display business rule ?

Hi,

Then why we are able to see previous object in display BR script ?

I did a little test for this to see what is actually happening with previous. 

 

  1. In an incident, I set short_description to "test".
  2. I created a Display BR with this as the action to take:

 

current.setValue('short_description', "THIS IS NOT A DRILL");
current.setValue('description', previous.short_description);

 

  • The results showed that the current value for short_description updated to "THIS IS NOT A DRILL" on display. However, the description field showed the same value rather than "test" which was the original value. So, even though previous exists as an object that "could" be used, it is not correct for Display BRs.
Claude E. D'Amico, III - CSA