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

May I know if it is possible to set a constraint where certain group of users can see certain page view of a web-based InfoPath 2007 form?

Scenario:
I have 3 group of users - Group A, Group B and Group C
In my InfoPath form, I have 3 views - View All (which only Group A can view), Issue Loan (which only Group B can view) and Repair (which only Group C can view).
I do not wish to create 3 different form and hope to utilize the page view for InfoPath form in my scenario.

share|improve this question
    
Are you using InfoPath with SharePoint? If so, what version? There are some very cool things you can do with MOSS 2007 that you cannot do with WSS3.0 using the UserProfileService as well. –  Lori Sep 16 '11 at 13:40
    
Can tell me more about the UserProfileService. (By the way, your UserprofileService is not the GetUserProfilebyName, correct?) –  Wilson Tan Sep 23 '11 at 8:25
    
The UserProfileService.asmx is a web service, there is a method called GetUserProfileByName which can be used to get a user profile, within that, you can get all of the available properties that show in the profile, including groups. Then you could use a rule that if the groups contains "Group A" then open in View All. –  Lori Sep 23 '11 at 12:54
add comment

1 Answer 1

up vote 0 down vote accepted

You can but it is not simple. I will provide some info to get you started.

Basically you need to find current user groups and then build view conditions according to your needs. This can be done by some coding or by using SharePoint webservices. There is one nice web service called Users and Groups Web Service with method called UserGroup.GetGroupCollectionFromUser Method. If you provide user login name to it (eg. by using userName() function in InfoPath) it will return all users groups.

However there is slight problem and InfoPath doesn't handle web service results as expected. This can be fixed by following steps in this article:

InfoPath: Displaying SharePoint Group List Using “GetGroupCollectionFromUser” method

And here you have one great tutorial that almost cover your requirement:

InfoPath – User Roles in Browser-Enabled Forms Using AD Groups

share|improve this answer
    
I agree that InfoPath can only be used for simple form and not for complex requirements. I will mark your answer as the solution since it looks like there is no other way to do it. –  Wilson Tan Oct 19 '11 at 5:32
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.