InfoPath 2007: Get User profile details using SharePoint User Profile web service

Requirement:

I will select a user in a people picker or contact selector control (Requestor field) on an InfoPath form and I need the user’s Work Phone number (Work Phone) to populate in another field.

Solution:

1) Create a receive data connection to pull the user profile details using UserProfile.asmx web service provided by SharePoint (GetUserProfleByName method needs to be selected)

2) Create a rule for the “Requestor” field with these Actions:

  • Action 1: Set AccountName query field of UserProfile data connection to use the value of the user selected
  • Action 2: Query UserProfile data connection
  • Action 3: Set WorkPhone returned by the web service to the Work Phone field of the InfoPath form

This should do the trick. You can refer the below article for step by step procedure:

http://claytoncobb.wordpress.com/2009/06/21/userprofileservice-extended/

Please leave a comment in case you liked the post or you need my assistance in the course.

Advertisements

Auditing/Versioning – InfoPath 2007 Form Fields

My requirement is to track changes each and every field within a InfoPath form for auditing and reporting needs.

Concept:

I took the route of leveraging SharePoint Out-Of-The-Box versioning functionality instead of developing custom components as such.

As a matter of fact, if we cannot track the changes to the form field values within a InfoPath form then we should try and track it at the destination which is our SharePoint Form Library where these InfoPath forms get deployed.

In simple words…..If not the source, try to track it at the destination.

Steps:

1) Promote all the relevant fields from InfoPath form to SharePoint Form Library so that whatever values are updated get noted down at the SharePoint Form library level

2) Once you have promoted all the fields, you would need to create calculated columns for each of these promoted columns. This is because of the fact that the promoted fields are just dummy columns in the Form Library and we don’t have any control on them. So, we will have to create calculated fields to capture the values of these dummy columns.

3) Enable versioning on the SharePoint Form Library under List Settings -> Advanced Settings/Versioning Settings

This should create version(s) everytime the InfoPath form field values change.

Hope I have been clear on this. Please do not hesitate to leave a comment in case you are not able to understand the above specified steps or you were happy to reach this article.