Writing values to a Moss2007 user profile

August 28, 2008   9:14


It took me quite some time to figure out how to write information to a SharePoint user profile. The web seemed only full of examples about how to read information from profiles. At the MSDN site there is an example, but they are using the UserProfileService web service.

At the end it turned out to be very simple to update the values in a user profile: just update the value in the property and then do a Commit on the profile.

using (SPSite site = new SPSite(”http://sharepointsite”))
{
 UserProfileManager uPMgr =
 new UserProfileManager(ServerContext.GetContext(site));
 UserProfile profile = uPMgr.GetUserProfile(”Administrator”);
 profile["WorkEmail"].Value = “newemail@address.com”;
 profile.Commit();
}
Tags: , , , .





How to quickly edit multiple Web Service urls inside an InfoPath form

November 10, 2007   20:06


How to quickly edit multiple Web Service urls inside a InfoPath formA good way to communicate with SharePoint from within a InfoPath form is to use Web Services. Normally you will manage the data source type Web Service with the help of the Data Connection Wizard. To investigate the web service you often have to supply the wizard with some example parameters, especially when the web service doesn’t return any result with empty parameters. Providing those parameters can take quite some time if you have to update more as one web service.

One of my current projects included 5 InfoPath forms with each 6 web services. Clicking through the Data Connection Wizard to update the url would take quite some time and I only needed to change the location. My test environment used the same web service as in production, but because of the different server name I had to update the urls to make the InfoPath forms work.

I found some interesting instructions in the InfoPath documentation and I decided to take it to the test. It turned out to be a good and quick way to update the urls. If you are facing the same situation as me follow these steps:

(more…)

Tags: , , , , , .









The content expressed in this blog are those of Edwin Vriethoff and do not represent his employer's view in anyway. The contents of this blog has been carefully put together, but Edwin Vriethoff is not responsible in any way for any direct or indirect harm caused by individuals or organizations using the content of this blog in any way.