Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

View Rules do not apply to new records

tahnalos
Kilo Sage

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

13 REPLIES 13

Brad Tilton
ServiceNow Employee
ServiceNow Employee

You would need deactivate the view rule for this to work I think.

And also:

"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."

How do I accomplish that?

Brad Tilton
ServiceNow Employee
ServiceNow Employee

I didn't realize you were using the new button. I don't think you control the url in that case unless you created a new New ui action for that list and had it do a redirect.

I agree that may be the approach, but such a new button as UI Action would have to be done on the child form itself as a List Banner button.  Is there any way to determine parent if this button is being used to initiate a child?