- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 04:01 AM
Hi experts,
We have a requirement to apply reference qualifier for a reference field based on for form view. We have 2 views for location table say A & B. The reference qualifier specified on the Dictionary entry should be applicable only for view A and not on B.
I have already checked the exact similar question in community but didn't find the solution. Solved: Re: Reference Qualifier based on Form View - ServiceNow Community
How can we achieve this.
TIA.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 05:03 AM
@si21 - Please update the encoded string and form view then try. Please make sure this change should not have any impact to other table that has reference to the locations table which is one of the foundation data.
javascript: gs.action.getGlideURI().getMap().get('sysparm_form_view') == 'view A' ? 'encoded query string to apply for view A' : 'encoded query string to apply for view B'
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 04:38 AM
The problem is that you've created two views instead of two roles.
At the core is the idea that two populations of users can do two different things.
That should be ROLE based, NOT view based.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 05:03 AM
@si21 - Please update the encoded string and form view then try. Please make sure this change should not have any impact to other table that has reference to the locations table which is one of the foundation data.
javascript: gs.action.getGlideURI().getMap().get('sysparm_form_view') == 'view A' ? 'encoded query string to apply for view A' : 'encoded query string to apply for view B'
Thanks & Regards,
Vasanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2023 06:08 AM
Hi @Vasantharajan N , thank you for the script It's working fine. I have small doubt here where do we add view B in the above script.
and what If I have more than two views on the form. Could you please help me here. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2023 09:55 PM
Hi @si21 - You may define a script include to assess the different form view which you wanted to assess and return the right encoded query.
Thanks & Regards,
Vasanth