Applying before query Business Rule only on List layout, not on Form layout

Mark Roethof
Tera Patron
Tera Patron

Hi all,

 

I would like to create a before query Business Rule which only runs on the List Layout, and not on the Form Layout. And for both on the same view.

 

Any ideas on this? I only did some small investigation yet, though thought maybe on the Community there are some people with some insight on this 🙂

 

I did already do a quick try with a condition like for example:
RP.getReferringURL().contains('_list.do')

That does work basically on both form and list. Though when performing an update on the form, it throws errors, so not yet what I'm looking for.

 

Any ideas?

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn

1 ACCEPTED SOLUTION

benn23
ServiceNow Employee
ServiceNow Employee

Might try prefacing it with 'global' to see if that helps.

global.RP.getReferringURL().indexOf('_list.do') >= 0

View solution in original post

2 REPLIES 2

benn23
ServiceNow Employee
ServiceNow Employee

Might try prefacing it with 'global' to see if that helps.

global.RP.getReferringURL().indexOf('_list.do') >= 0

Applying indexOf instead of contains looks to be solving the error message when saving a record. Interesting, wasn't aware of issues using contains in a condition.

 

Tnx!

 

Kind regards,
Mark

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn