Posts Tagged ‘sharepoint 2010’

Activity ‘onWorkflowItemChanged’ validation warning: The correlation token may be uninitialized

Sunday, September 23rd, 2012

Update: the below information is useful reference, but you may find it leads to undesirable results, where your workflowItem events fire repeatedly. Read the below, and then read this.

Working in Visual Studio 2010 and designing SharePoint 2010 state machine and sequential workflows, you may come across the following warning message when building and deploying your solution when using the onWorkflowItemChanged event:

Activity ‘onWorkflowItemChanged’ validation warning: The correlation token may be uninitialized

You will also probably notice that your workflow doesn’t respond or wake up to any onWorkflowItemChanged events. This is almost certainly due to the correlation token you’re using. The way to get this working correctly is:

1) Add (or check) the onWorkflowActivated event (which should be the first event in your workflow), ensure that you have specified a correlation token (e.g., workflowToken) with an OwnerActivityName of your workflow (e.g., Workflow1 or whatever you changed its name to)
2) In your onWorkflowItemChanged event(s) elsewhere in the workflow, using the same details for the correlation token – i.e., workflowToken and Workflow1.

You will notice when using these events within state machine eventdriven activities, that you can’t select that token in the correlation token dropdown. (This is what normally leads you to choose or create an incorrect correlation token.) However, you can just manually write in the details.

The reason / logic behind this is explained really well, here, in terms of the use of tokens and working out what “scope” different events require.

Quick tip: Access Denied when editing navigation (areanavigationsettings.aspx) in MySites

Thursday, May 3rd, 2012

If you encounter an issue, specifically in MySites, where you get an Access Denied error trying to edit the navigation, check whether you have the publishing feature enabled. I had this same issue when “Enterprise features” were re-enabled at the Central Admin, which for some reason enabled that on the My Site host, which isn’t needed.

SharePoint 2010 Foundation + SQL Server Reporting Services Integrated mode installation issues: Failed to establish connection with report server, 401 errors and more

Thursday, February 9th, 2012

You may be trying to set up SharePoint 2010 to act as the report repository for SQL Server Reporting Services report. This is a pretty nifty feature, especially as it’s available in the Foundation (i.e., Free) version of SharePoint. There is a pretty exhaustive guide on how to set it up and for extra help, this blog post is pretty good too, and if you follow the steps, you get pretty far. However, if you’re in a multiple server setup (i.e. your SQL server isn’t on the same server as your Central Admin) you will likely encounter configuration issues surrounding authentication, and there is a great deal of confusion about what it all means – especially when it comes down to Kerberos. That’s beyond the scope of this post – what I’m covering here is one very annoying issue that there was no definitive answer to on the web.

Assuming you get all the server parts setup and Reporting Services configured, you might find that you can browse to your report server address on the machine hosting reporting services, but, if you try to browse to that address from anywhere else, you’ll get an endless stream of login boxes, and no credentials will work. Also, if you go to Central Admin and go to General Application Settings > Reporting Services Integration, when you fill in the details to connect to reporting services, you’ll hit an error like:

Failed to establish connection with report server. Verify the server URL is correct or review ULS logs for more information. Product area: SQL Server Reporting Services, Category: Configuration Pages

and, in the ULS logs, an error like:

SQL Server Reporting Services Configuration Pages Failed to retrieve RS configuration information: System.Net.WebException: The request failed with HTTP status 401: Unauthorized.

Here’s how I fixed it my workaround.

(more…)

SharePoint 2010 context menu item with custom code

Wednesday, September 28th, 2011

List items in SharePoint lists and document libraries have a “context menu” on the Filename/FileLeafRef field. When you hover to the right of the field, you see a drop down menu with a bunch of options. You can add your own items to this list, and also run custom code when the item is clicked. This tutorial will show you how, using Visual Studio 2010 and SharePoint 2010.

Edit: 16/02/2012 – there were a few comments about the custom assembly not firing. I’ve revised the post below to include an extra bit in the XML to ensure the control loads (see #13.)

(more…)

SharePoint workflow + list item edit + value cannot be null

Thursday, May 26th, 2011

You may encounter a random error when using a custom Visual Studio SharePoint 2010 workflow. Everything appears OK, but when you go to edit the item that the workflow is running on, the EditForm fails to load and you see an error like:

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: s

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: s]
System.IO.StringReader..ctor(String s) +10151478
System.Xml.XmlDocument.LoadXml(String xml) +51
Microsoft.SharePoint.Publishing.Internal.WorkflowUtilities.FlattenXmlToHashtable(String strXml) +90

(more…)