0

Is there a way to get access to the current view name in InfoPath?

For example I want to use it in a condition on a rule:

If current view = X then set the value of a field on load.

This is part of implementing a sharepoint group based permission system for controlling access to particular views of a form.

The current plan is have a series of rules that say if current view = X set a required group field to y. If user is not in group y then switch to read only view.

0

I don't think so..

However if you set the view explicitly on form load then at the same time as you set the view you can set any fields or view specific values you want

For example If you had a couple of boolean fields that define permissions like:

inSales
inFinance

Then on form load you call the GetGroupCollectionFromUser method on the SharePoint UserProfileService as described in detail here:

http://jaliyaudagedara.blogspot.co.uk/2011/05/getting-current-users-sharepoint-group.html

you can then run a series of checks to see which group the user is in and set the boolean fields.

The boolean fields makes the rules to hide sections and set the view mush easier to write.. and read

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy