View Rules are not applied after clicking the Save button in the portal.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I created a View Rule to display the view based on the customer type—ITSM Customer View for ITSM customers and Ozean Customer View for Ozean customers.
It works when opening the record in the portal, but after clicking any UI action, it switches to the CSP view. I want to restrict this behavior. I’m attaching the View Rule code below, screenshot for initial load, and after clicking the UI action behavior
View Rule:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @Karthik152 ,
There must not be anything wrong with View Rule logic and that is why it is working correctly on load.
The issue is it is redirecting to another view whne you click on UI actions.
In UI Action - you need to create the redirection logic to redirect back to same view.
Please apply the logic in your ui action. Please follow the syntax as belo:
// Redirect to the 'MyCustomView' of the current incident record
action.setRedirectURL("incident.do?sys_id=" + current.sys_id + "&sysparm_view=MyCustomView&sysparm_view_forced=true");
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!
Thank you!