Saturday, November 27, 2010

Deploy WebPart Page with Custom Web Part into SharePoint 2010 Sandbox

Issue

I recently ran into an issue with deploying a custom web part in the SharePoint 2010 Sandbox. What I had done was create a custom web part that worked just fine in the SharePoint 2010 Sandbox.

The next thing I wanted to do was provide a web part page as part of my solution package with the custom web part added to the web part page. This way when the deployment is complete, there is a page ready to go with the web part and no one needs to do a manual step of creating the web part page and configuring the web part.

Provisioning the web part page was no problem, however when I had configured the page with the custom web part I received the following errors which were no very helpful.

SharePoint Foundation Web Parts 8l4f Monitorable Error importing WebPart. Assembly MyAnonymousComments, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dce01f6d2636f2c1, TypeName. MyAnonymousComments.SubmitAnonymousComment.SubmitAnonymousComment, MyAnonymousComments, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dce01f6d2636f2c1 6a9ded04-b7dc-42df-8f5a-af6037857a8b

SharePoint Foundation Web Parts 7935 Information http://win-osd73bv7a62/sites/AnonymousCommentPages/AnonymousCommentsLanding.aspx - An unexpected error has been encountered in this Web Part. Error: Cannot import this Web Part., DesignText: <webParts> <webPart xmlns="http://schemas.microsoft.com/WebPart/v3"> <metaData> <type name="MyAnonymousComments.SubmitAnonymousComment.SubmitAnonymousComment, MyAnonymousComments, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dce01f6d2636f2c1" /> <importErrorMessage>Cannot import this Web Part.</importErrorMessage> </metaData> <data> <properties> <property name="Title" type="string">Submit Anonymous Comment</property> <property name="Description" type="strin... 6a9ded04-b7dc-42df-8f5a-af6037857a8b

SharePoint Foundation Web Parts 7935 Information ...g">Web part that will submit anonymous comments into a list.</property> </properties> </data> </webPart> </webParts>, SourcePreamble: DWP 6a9ded04-b7dc-42df-8f5a-af6037857a8b

SharePoint Foundation E-Mail 6871 Information The Incoming E-Mail service has completed a batch. The elapsed time was 00:00:00. The service processed 0 message(s) in total. 07e8b8a8-b763-4ad3-8836-ecd457f50303

Resolution

The resolution was that I needed to add a solution tag like the one below. I did not need this Solution element when configuring other out of the box SharePoint web parts, but when it comes to custom web parts that are deployed into the SharePoint 2010 Sandbox this is needed. I assume it because the DLL where the part is located is not in the GAC or the bin, so the Sandbox runtime needs to know where the DLL is located. The GUID for the solution package tells it where it is located.

      <AllUsersWebPart WebPartZoneID="Left" WebPartOrder="1">
<![CDATA[
<webParts>
<webPart xmlns="http://schemas.microsoft.com/WebPart/v3">
<metaData>
<type name="MyAnonymousComments.MostRecentResponsesWebPart.MostRecentResponsesWebPart, MyAnonymousComments, Version=1.0.0.0, Culture=neutral, PublicKeyToken=dce01f6d2636f2c1" />
<importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage>
<Solution SolutionId="0a30dc69-b582-4a69-97d2-99862248c74e" xmlns="http://schemas.microsoft.com/sharepoint/" />
</metaData>
<data>
<properties>
<property name="Title" type="string">Most Recent Responses</property>
<property name="Description" type="string">Will retrieve the most recent anonymous responses.</property>
<property name="ListName" type="string">Anonymous</property>
</properties>
</data>
</webPart>
</webParts>
]]>
</AllUsersWebPart>

Reference

This link pointed me in the right direction - http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/a560e34a-db4e-47d8-b8bf-965cf170e9d4/

Friday, November 26, 2010

SharePoint 2010 Add Navigation to Search Center

By default the SharePoint navigation will not appear in the Search Center. If you need it to display, here is a really simple solution that works. You just have to use SharePoint Designer to resolve it really quickly - http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/cd568f4b-6372-480a-b393-ad3d9ab1db84

Tuesday, November 16, 2010

SharePoint Administration Free Hands on Labs

I have also just come across a full set of IT Pro related Virtual Labs for SharePoint 2010. They are located here - http://technet.microsoft.com/en-us/virtuallabs/bb512933.aspx.

There are virtual labs that cover:

  • back-up/restore
  • BCS
  • continuity management
  • remote blob storage
  • tenant administration (i.e. setting up re-usable services)
  • user profile configuration
  • upgrades
  • monitoring
  • performance management
  • power shell
  • installation and configuration
  • etc.

SharePoint 2010 Enterprise Search Hands on Labs

Do you want to really start learning the difference between SharePoint 2010 Search and FAST for SharePoint? No better way to do it other than some good self-paced training and some hands on labs.

Here are the following:

Saturday, November 13, 2010

SharePoint Designer 2010 Workflow and InfoPath 2010 Notes

I was recently building up some SharePoint 2010 functionality and ran into a couple small things I would like to share.

Document Sets and InfoPath Forms

There is a new cool feature of SharePoint 2010 that allows you to modify the Update form of a SharePoint list with an InfoPath form. This is really powerful because you can now push in custom logic around the data in your lists. As well, there are Document Sets which are basically folders that can be treated like documents or list items. In SharePoint 2007 a folder was a folder. But now with SharePoint 2010 Document Sets you can create content types of this type, add on metadata, associate workflow, add security, etc. However there is a limitation of both:

· Document Sets only work in Document Libraries

· InfoPath List forms only work in SharePoint Lists.

So if you ever want to do a cross-section of both features it is currently not possible.

SharePoint Designer 2010 Multiple Person/Group Picker In InfoPath Task Form

I created a workflow in SharePoint Designer 2010. In one of the task forms I wanted to allow the user to enter in a list of people who will perform the next action in the workflow. I did not want the data to be part of the list item because I wanted the manager to determine who would these tasks and not the person who is entering the original list item. What I found out was the InfoPath form would allow me to select multiple users to perform the next step but all of the values would be lost except for the first one once I hit submit on the form. Here is a reference.

http://social.technet.microsoft.com/Forums/en/sharepoint2010customization/thread/e720a3e2-e33b-42d4-ad3b-40696172fcd1

This was brought up but apparently not fixed before RTM.

Workflow Coercion Exception

You may see the following exception in your SharePoint Designer 2010 workflows:

SharePoint Exception: Coercion Failed: Input cannot be null for this coercion

This exception is not that helpful but this is typically associated to when you try to set a value to an item field or internal variable of your workflow. I have seen the issue on choice fields, people pickers, etc. Instead of selecting Return field as “XXX, Comma Delimited” select “As String”. This will resolve the issue.

Visio Must be installed to Publish Workflow with Visualization

If you are creating a SharePoint Designer 2010 workflow and the checkbox to enable Visualization is disabled you need to have Visio 2010 installed on the machine where you are doing the workflow publication. This is because the Visio visualization is built when the process is published, and it NOT based on the export .vwi file. This is why the workflow visualization looks different between the Visio diagram and the work you see on the workflow status page in SharePoint for the running workflow instance.