
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:13 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:36 AM
Might try prefacing it with 'global' to see if that helps.
global.RP.getReferringURL().indexOf('_list.do') >= 0
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:36 AM
Might try prefacing it with 'global' to see if that helps.
global.RP.getReferringURL().indexOf('_list.do') >= 0

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2023 09:46 PM
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