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] |
 Thursday, November 29, 2007

Sharepoint Audiences and AD Groups

Recently, I had to change the AD import connection for my Sharepoint user profiles.  I noticed after this change the audience memberships were not compiling.  I searched the web and found nothing exactly solving this issue.  Many of my audiences are based on groups in AD.  I checked the rules again and found when I brought up the browser to select users/groups, the groups were all listed twice or even three times.

Temporary fix: I had to select the bottom most listing to get the audience to have members again.  I am not sure why it is doing this.  There must be some purge tool which can clear out the list of groups and then rebuild, but I haven't found it yet.

Thought I would pass this along in case anyone else is encountering this same issue.

#    Comments [1] |
 Tuesday, November 06, 2007

Sharepoint Connections Conference

Here in sunny Las Vegas at Mandalay Bay!!  What a large hotel this is.  I have to walk 2 miles just to get to the ballrooms.  (Just kidding, but it is a good walk to get there).  So many restaurants.  Have to listen to helicopters landing and taking off, but it's just part of it.

I really like this conference.  They have a wide variety of classes to choose from.  The attendance this time is the largest yet at 5000.  The keynote speech was good with a quick overview of where Microsoft is going next year.  They are due to release Visual Studio 2008 by the end of this quarter.  SQL Server 2008 and Windows Server 2008 are due in the first half of next year.  SQL 2008 has a ton of great features.  They incorporated the Dundas charts into Reporting Services.  I hope the virtualization claims they have made about Win 2008 come true.  VS 2008 has some really good features for integration with Sharepoint and click-once deployment.  I only wish our firm was using Office 2007, so we could use all of the integrated features between all of these products.

#    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] |
 Wednesday, October 10, 2007

Spell check bug in Sharepoint permissions

The spell check issue has been posted elsewhere, but I thought I would give my own experience.  I had one user who could not use spell check when entering an Announcement on their site.  The site had broken permissions (uninherited) and new groups created specifically for the site.  I eventually had to re-inherit parent permissions to get it to work.  I think this is a bug.  It should not matter if they have inherited permissions or custom.  As long as they have contribute rights, they should be given all necessary functionality.

#    Comments [0] |
 Wednesday, October 03, 2007

Sharepoint Connections Conference

Just want to put in the good word about DevConnections, specifically the Sharepoint Connections sessions at the conference...

I attended this conference earlier this year in Orlando.  It was really good with a lot of content about Sharepoint.  There are many other sessions going on related to .NET, Visual Studio, SQL, etc.  You are free to attend any of these other classes with the purchase of one conference pass.  I really enjoyed seeing the latest in Windows Mobile technology.

Look forward to seeing you there in Vegas...

P.S. If you have the stomach, try these out when you are there, especially Big Shot.  Awesome experience!

#    Comments [0] |
 Friday, September 28, 2007

Sharepoint and K2 Workflow

Just a quick posting about K2 and how they work with Sharepoint...

Over the past months, I have been exploring the best way to get workflows working at the firm.  We have so many processes to tackle which is exciting.  However, I want to go about it in the most efficient manner.

First, I started investigating Sharepoint's OOTB (out-of-the-box) workflows.  In my opinion, they are good for basic workflows with an audience of more advanced users.  I say advanced users because the email which is generated OOTB sucks and does not provide a one-touch solution to get the workflow completed.  For example, I did a simple approval workflow against a document library with a Word document as its base content type.  When my manager got the email to complete the approval, he clicked on the first link in the email and resubmitted the form.  The step to actually click Approve or Decline is buried on the edit task page.  So, I set out to edit the email to provide a clear cut link to the Edit Task page.  I found out it can't be done OOTB.

Second and third, after my experience with OOTB, I moved on to Sharepoint Designer (SPD) and Visual Studio.  Definitely, this is a more advanced way to get workflows done.  The problems I had were with unexplained errors cropping up here and there.  I started my learning of how to use these tools by reading a few excellent books, Workflow in the 2007 Microsoft Office System, Pro InfoPath 2007, and Microsoft Sharepoint - Building Office 2007 Solutions in C# 2005 (the last book being the best one).  However, even with the excellent examples in these books, I still had problems with these tools and creating workflows.

It seems that with workflows and using MS products they are either "too generic/easy to create" or "very specific/very difficult" to create.

I decided to try out K2.  At this point, I have been able to build a workflow, but have not tried to tailor the email yet (due to time constraints/project deadlines).  But, I can say they have been extremely helpful.  They have a good group of tech support people.  I did run into some installation errors, but they had to do with permissions, patches, etc.  Once it got working, it has been really cool to use.

I'll post some more about K2 as I go through more of my trial.  We'll see if the firm eventually purchases this product, but I am leaning that way at this point.

#    Comments [0] |