Thursday, December 06, 2007

Site columns, InfoPath, and XML - How to edit the value of a site column coming from an InfoPath form

In the same InfoPath form I listed in a previous post, I know found myself needing to edit the value of a site column I set up in the form's document library.  When the form is opened, it reads the Department field from AD and fills this in the department field on the form.  When the form is submitted, it then populates the Dept site column with this value.  The Dept site column is then shown on the various views of the document library.  The problem is some of the users' department value in AD is either incorrect or missing altogether.  So, I corrected the AD values for the users, but what do I do with the values already submitted to the document library?  If I opened the InfoPath form and submitted it again, it would put me as Created By (uneditable field) and not the user, which is crucial for other connected web parts.

Good old Sharepoint Designer (in this case, anyway)!  I opened the site in Sharepoint Designer and navigated to the doc library.  I saw all of the InfoPath XML files.  I then right clicked and selected Open With > Open with Sharepoint Designer (Open as XML).  I found the value which was populating the site column and changed it there.  Tah-dah!  The value in the site column was changed and it put me as Modified By, but not Created By.

#    Comments [0] |
 Friday, October 26, 2007

Sharepoint Invalid Character - InfoPath Submit Error

I found an interesting gotcha with Sharepoint and InfoPath yesterday.  A user called me about an error they were receiving when submitting a web-enabled form.  The error was "An error occurred while the form was being submitted".  It's a pretty generic error, so I started searching.

My form calls a web service, userprofileservice, to gather the user name and department from AD.  When the form is submitted, it automatically titles the file, "Selected Year + UserName", i.e. "2009 John Doe".  In the case of this user, his name was "John Doe, Jr."  What I found was Sharepoint does not allow a period "." at the end of a file name within a list or document library.  In fact, there are several invalid characters.  So, I changed the automatic naming to "Selected Year + UserName + 'Plan'", i.e. "2009 John Doe, Jr. Plan".  This worked perfectly and the form submits.

Thanks to this blog for helping with the solutions: http://blogs.officezealot.com/legault/archive/2007/04/26/20302.aspx

#    Comments [1] |