Setting view when record is accessed from list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 09:37 AM
I am trying to default a view to testview for incident when access from a list. I tried to create view rule as follows but is doesn't work. Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 10:16 PM
You are missing the { and } characters.
if ( -criteria-) {
do this
}else{
do something else
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 10:54 PM
Hi @samadam ,
Is that view name correct? Cross verify the name of view in "sys_ui_view" table. I believe that will fix the issue.
Regards,
Dhanraj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2024 11:40 PM
Hi @samadam ,
You can use below script.
if (is_list)
answer = 'your view name';
else
answer = null;
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------