Wednesday, April 30, 2008

Sharepoint, workflows, CodePlex, and other invaluable resources to do my job

Recently, I worked on a Sharepoint project solution for our attorneys to be able to create projects and assign them to summer associates.  When the project is completed, a workflow kicks in and sends an email to the responsible attorneys to let them know it is completed.  In building the email, I ran into a problem with converting the user name of the assigned associate into their real name.

In the workflow built with Sharepoint Designer, I added a lookup field to the Subject line of the email.  It came from the Current Item and the AssignedTo column.  The email was sent and in the subject line the name was formatted “domain\username”.  So, how do I convert the name?

After looking and looking for help, I found a wonderful open source solution for custom workflow activities on CodePlex.  It has a nifty activity called “Lookup user info”.  The lookup allows you to query a user profile property by their user name.  (There is a screenshot of this on CodePlex)  I am still amazed at how Microsoft doesn’t have this OOTB.  Anyway, this wasn’t the end of the story.

I was interested in finding the real name of the user.  In the query field, I put in “Name” which seemed logical coming from AD, but got nothing back.  I realized it was looking for the Sharepoint version of the user properties.  I then went to the next CodePlex tool, Stramit CAML Viewer.  What an amazingly handy tool!  I then looked up the User Information List under my root URL and found the real name was actually called “LinkTitle”.  In the end with the help of a couple of tools, the email subject had the exact format I needed.  It was “Evaluation form for actual name(LinkTitle)”.

IMHO, Sharepoint and SPD are great together.  However, there are some vital integration pieces Microsoft left out.  I shouldn’t have to go to Visual Studio or open source to convert an AD user name to their “friendly name”.  AD is their product and they should build their products to FULLY integrate with each other in the easiest ways.  That’s my 2 cents and maybe there is another way, but I haven’t found it yet.

#    Comments [0] |
 Friday, April 25, 2008

Arranging editing columns in a DataFormWebPart using Sharepoint Designer

Recently, I was building a training class solution explained here.  After building the solution, I noticed the behaviour of the Edit columns was acting strange.

The Attendees list showed the Edit column.

However, when you click the Edit button, the columns became rearranged.  Notice the save/cancel under the Name heading.

Opening Sharepoint Designer, I found the code where the columns were detailed. Notice the @Author and Sharepoint:FormField are below the dvt_1.automode template call.

To correct the arrangement, copy from the xsl:if to the /xsl:if and move to below the Sharepoint:FormField /td tag.

Now you get the final result (The Title was added later as an extra requirement from our Training Department.)

Click Edit

Now the columns are in the proper order

Hope this helps and thanks to Natalya Voskresenskaya Blog for an excellent solution!

#    Comments [0] |
 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, November 30, 2007

.NET Framework 1.1 Service Pack 1 update not installing through Windows Update on Vista

Thanks to Annoyances.org for the solution to this:

http://www.annoyances.org/exec/forum/winxp/1196364537

You have to download the service pack from Microsoft and install manually.  After install/reboot, run Windows Update again.  The SP should not show up anymore.

#    Comments [0] |