SP Insider - A SharePoint Blog

Migrate a SharePoint workflow from Visual Studio 2008 to Visual Studio 2010

This is a useful article when converting a custom workflow project from Visual Studio 2008 to Visual Studio 2010:

http://blogs.msdn.com/b/bethmassi/archive/2010/01/15/migrating-a-2007-workflow-to-visual-studio-sharepoint-2010.aspx

In a nutshell,

Go ahead with the conversion wizard
Add a new Project (2010 Sequential Workflow Project) to the solution
Rename the Workflow1  folder to the new name – Very Important, you have to keep this folder in order for the workflow to be in the feature, so just rename it.
Copy the old workflow.cs file to the new folder in the new project. This will bring over the designer file and rules file (if applicable).
Delete the worflow1.cs
Copy over all other files that are not related to packaging such as Utility classes.
Copy default namespaces to new project. Check your default namespaces, namespaces in Elements.xml, assembly versions
Update namespace in new project on the .cs file, and .designer.cs file.
Compile, if does not compile, may have to remove Office reference in [...]

Debugging Custom Event Receivers – Strange Error on custom Event Receiver SharePoint 2010. .c__DisplayClass2.b__0()Object reference not set to an instance of an object.

Debugging Custom Event Receivers.

Here’s a weird error that took some time to figure out. Generic “Object reference not set to an instance of an object.” Error on a custom SharePoint 2010 event receiver. If I went through the UI to change a field on a list, the event receiver fires fine. But, if a workflow changed the field it threw the error below. I finally found if I attached the OWSTimer process to Visual Studio, it would debug, but still not show the exact problem. The solution is to find the Log On account for OWSTimer in the Services console (services.msc) and then to grant that account permissions on the list that the event receiver is running on.

Edit -checking the permissions of the OWSTimer account is just one possible solution.  What I found out was that the list was hanging on to old event receivers as well.  I had [...]

Missing All People Links in SharePoint 2010

We used this to delete users from the site collection in SharePoint 2007. It was gone in 2010, but really just “hidden.”

Simply paste the following URL into your browser and change the site name and you wll get the All People page back.  Useful for deleting users from the site collection.

http://My2010Site/_layouts/people.aspx?MembershipGroupId=0&FilterField1=ContentType&FilterValue1=Person

Hide Left Navigation in SharePoint 2010

Here’s a quick reusable way to hide the left navigation.

 Create a text file called “HideLeftNav.txt” in a document library.

 Add the following css code:
<style type=”text/css”>
/*–Hide Quick Launch –*/
#s4-leftpanel{
display:none
}
.s4-ca{
margin-left:0px
}
</style>

 
 Edit the page you want to hide the nav on, add a content editor webpart. Then, simply reference the url to the HideLeftNav.txt file and you are done.

 

Creating a WCF service on a SharePoint 2010 server in Visual Studio 2010 and “Type can not be found” error

If you get the “Type cannot be found” error after installing your WCF service, go to the section about unloading your project below.

Here are the main steps to creating a WCF service and installing it on a SharePoint 2010 server:

Open Visual Studio 2010
Create an Empty SharePoint 2010 project to get the packaging files
Change your namespace in the Project Properties.
Add a new Item, WCF Service with a new file name
Add the following lines above the class declaration that implements the “IService” file:

[BasicHttpBindingServiceMetadataExchangeEndpointAttribute]

[AspNetCompatibilityRequirementsAttribute(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

public
class
PricingRequestService : IPricingRequestService

{

Add the following references to your project:

C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14ISAPIMicrosoft.SharePoint.dll
C:WindowsassemblyGAC_MSILMicrosoft.SharePoint.Client.ServerRuntime14.0.0.0__71e9bce111e9429cMicrosoft.SharePoint.Client.ServerRuntime.dll

Add a mapped folder to the “_Layouts” folder
Inside the _Layouts folder create a text file with a .svc extension such as PricingRequestService.svc

Add the following sample: <%@ServiceHost
Language=”C#” Debug=”true”

Service=”PricingRequest.PricingRequestService, $SharePoint.Project.AssemblyFullName$”

Factory=”Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory, Microsoft.SharePoint.Client.ServerRuntime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”
%>

Change the namespace and service name to your own. Leave [...]

By |January 10th, 2013|Uncategorized|0 Comments|

How to turn off “Cannot be blank” yellow boxes on SharePoint 2010 Infopath custom list forms

 Find and make a backup copy of the Core.JS file(14templatelayoutsinc)
Edit the Core.JS file(14templatelayoutsinc)
Find the function called ErrorVisualization_ShowShortMessage
Add “return;” as the first command in the function.ErrorVisualization_ShowShortMessage(b,a,g){return;ULSrLq:;var h=g[2],d=””,e=null;if(!

 Reset IIS

 http://sharepointfeaturesandfailures.blogspot.com/2008/03/turn-off-hover-over-screen-tips-on.html

Metro Tiles in SharePoint 2010 and SharePoint 2013

Here’s a kind of fun web part I found on Codeplex. You can jump on the tiles bandwagon in SharePoint 2010. It’s packaged nicely in 2 wsp files and creates a list to hold the data. Built in images are very nice.
It’s called the Metro Grid webpart and they have done a nice job on the packaging and icons.
http://spmetrogrid.codeplex.com/

 

Notes from the Edge: SharePoint 2012 Conference, Las Vegas

Having just got home from Las Vegas, I’d like to relate some of the things I saw at the MS SharePoint 2012 conference. With over 10,000 attendees filling up the Mandalay Bay beach, I am amazed year after year of the growth. When I started working with SharePoint in 2001, who would have thought it turned into this.
Bon Jovi rocking out at Mandalay Bay for the SharePoint conference.

 Cloud everything
    You probably couldn’t go one sentence in any session without hearing cloud. What does this mean? You better get a strategy in place because it is coming fast. MS is “all in” on cloud according to Steve Ballmer. As a developer, or infrastructure professional things will change quickly. For developers it’s going to be about RESTful web services, JSON, javascript, jquery, cloud app model, Azure services, OAuth, OData and Azure services. [...]

Topics for in-house SharePoint 2010 training

Topics for in-house SharePoint 2010 training
Here are some ideas to cover during a company’s cutover to SharePoint 2010. Many users will be confused by the ribbon so that’s the main area of focus.

 Main navigation, how to use the folder icon to navigate home from any page.
How the ribbon works
Browse, Page tabs (on Pages)
Browse, Items, List tabs (on Lists)
Browse, Documents, Library tabs (on Libraries)
How the ribbon changes depending on what type of page you are on, page, list, or library
How the checkboxes work to View item, edit item
What do multiple checkboxes do if you select more than one?
Try it out, navigate to a document library, try to view item and edit item through the ribbon
Also show alternate way on the list by clicking Title or Edit icon
Try it out, navigate to a list, try to view item and [...]

SharePoint 2010 Workflow history error: “The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.”

 This is an interesting error message. When trying to see the workflow history of a SharePoint 2010 custom workflow I get the following error message:

 SharePoint 2010 Workflow history error: “The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.”

 
What was strange was that other workflow histories worked fine, so I went down the path of finding out where the limit was. My first stop was the “hidden” SharePoint history list. There is a good post on this here:
http://www.sharepoint911.com/blogs/laura/Lists/Posts/Post.aspx?ID=111

 So I looked at my list by appending the /yoursite/lists/workflow%20history

 I added a count column to one of the fields, and it said 12,500. I knew that wasn’t right, so it must be a limit being returned somewhere. I needed to go deeper.

 I loaded SharePoint 2010 manager from Codeplex onto the server and found that my top secret workflow [...]