Monday, January 18, 2010

InfoPath - GetUserProfileByName - Get user information on another person

You can obtain the functionality by using the webservice called: userprofileservice.asmx. Take a look at this guide:
http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx?

This guide does not have an example of how to get user information on another person. You can do this by:
  • Adding a field
  • Adding a button
  • Actions for the button:
  1. Set field value: GetUserProfileByName:myfields:QueryFields:AccountName = The field you added in step 1
  2. Recieve data with GetUserProfileByName
  3. Now you have populated the GetUserProfileByName with all the data on the new user from the SharePoint user profile database.
  4. Perform step 1 to 11 followng the guide in the link above to fill out fields of your choice

Tip of the day: The above mentioned method will leave you with a very rigid input field to get info on a new user. To solve this problem you can use the contact selector. Google: "InfoPath Contact Selector".

Done :-)
If this is making no sense at all let me know.
Best regards

REF: http://www.infopathdev.com/forums/p/7844/29319.aspx#29319

No comments:

Post a Comment