View Rules do not apply to new records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:08 AM
I have a form that is accessed through two different entry points. Depending on the entry point, a different view will be used.
I created a View Rule that checks to see if the parent that the form is initiated from is of a certain type. If it is, I expect to use View A. If not, I expect to use View B. View A is default, so I created the view rule for View B.
If I attempt to create a new entry of the form with type that is supposed to use View B, I should see view B, but I'm seeing view A.
Can someone clarify where I may have gone wrong here?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:31 AM
Could you share a screenshot or describe the conditions you've used to determine what the entry point is from the view rule?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:32 AM
Please let us know what script or condition you have written in those view rules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:44 AM
The condition of the view is as follows:
<parent reference field>.<another reference field>.type = <value>
Someone has suggested that the view rule will not work with dot walking. Can someone clarify?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2018 11:51 AM
That dotwalking won't work on a new record. The reason is that dot walking uses the relationship between the current record and the referenced record, and I think when the view rule runs when the new record is loaded that relationship doesn't exist yet.
Instead of using a view rule I would consider just passing the view as a url parameter when you redirect the user to the new record screen. Just add &sysparm_view=viewnameA to the end of the url.