Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.