Learn more about SQL Server tools

mssqltips logo
 

Tutorials          DBA          Dev          BI          Career          Categories          Webcasts          Whitepapers          Today's Tip          Join

Tutorials      DBA      Dev      BI      Categories      Webcasts

DBA    Dev    BI    Categories

Special Announcement: SQL Server Performance Tuning Tips and Tricks Webinar
 

Using InfoPath 2007 User Roles


By:   |   Read Comments   |   Related Tips: > Sharepoint

Problem

Business processing forms are created using InfoPath 2007. In several scenarios, these forms are needed to perform different actions depending upon the user accessing the form. Defining SharePoint groups for each business processing form can be quite challenging or perhaps not even feasible.

Solution

To overcome the above mentioned problem, one of the approaches to use User Roles in InfoPath 2007. User roles allow you to categorize users into one or more groups, either based on data in the form template or on Active Directory. Each "User Role" might see a different "view" within the InfoPath form. User roles can even be used to apply a basic workflow to the InfoPath form by combining it with rules.

In this tip, we would see how to to create different roles in InfoPath with different users and how to change the views depending upon the roles.

For our scenario, we have created a simple form which has two different views. One is an Employee view which contains basic goal information and other is a Manager View which contains both employee goals as well as review comments.

employee progress
goals

We would define two different user role categories - "Employee" and "Manager". To define a user role, go to Tools-> User Roles

user roles

Click on Add. A box will appear asking for the role information. Provide a meaningful role name which, in our case, is "Employee". Three options will appear to choose an appropriate identity for the role. These could be specific users, groups or a user name from a different data source. In our case, we have selected specific users to target for the role.

add user role

Click OK and repeat the same steps for adding another role of "Manager". After adding both roles successfully, we see a set of roles display:

manage user roles

The next step is to define the logic of switching the views depending upon the roles. For that go to Tools -> Form Options. We will switch the appropriate view depending upon the role whenever the form is opened. To do so, make sure "Open and Save" is selected. Then click on Rules and click on Add. A rule box will appear. Click on Set Condition. On the first field, select "User's current role" which is a field to compare. In the operator field choose "is equal to" and in third box which is of value comparison, choose "Manager" and click OK.

condition

Next Click on Action and select switch view to "Manager" and click OK.

rule

In order to test the logic, you need to preview the form using the different roles. Click Tools -> Form Options -> Preview category. Select either "Employee" or "Manager" from the Preview as drop-down list box, then click OK. For our case, we will first choose Employee.

form options

Click Prevew.

Now change the "Employee" to "Manager" and click on Preview.

employee progress
Next Steps
  • Use user roles to create different local group/roles at the form level without creating temporary groups at the site level.
  • Use user roles with rules to implement a very basic sequential workflow inside the form.


Last Update:


next webcast button


next tip button



About the author
MSSQLTips author Siddharth Mehta Siddharth Mehta is an Associate Manager with Accenture in the Avanade Division focusing on Business Intelligence.

View all my tips





Post a comment or let the author know this tip helped.

All comments are reviewed, so stay on subject or we may delete your comment. Note: your email address is not published. Required fields are marked with an asterisk (*).

*Name    *Email    Email me updates 


Signup for our newsletter
 I agree by submitting my data to receive communications, account updates and/or special offers about SQL Server from MSSQLTips and/or its Sponsors. I have read the privacy statement and understand I may unsubscribe at any time.



    



Learn more about SQL Server tools