Pages

Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Friday, August 31, 2012

How to: Set a date with correct time in a SharePoint list item

When adding a SharePoint list item the one field type that has given me most problems is the SPDateTimeField:

First there is the question of entering the date in a format that SharePoint accepts. Then there is the problem of getting the time zone right.

Fortunately, neither of the two problems are actually hard to solve – Microsoft has tried to make life easy for us by supplying the tools we need to solve them quietly and efficiently.

Saturday, March 17, 2012

SharePoint Sandbox: How to specify the solution ID

When creating solutions for the SharePoint sandbox, whether it is for SharePoint 2010 or Office365, the solution ID must be given whenever some kind of code-behind is used. This is because SharePoint needs to know which assembly to use. Without the solution ID SharePoint would just look in the GAC for the assembly, which would produce a 'File could not be found' exception.

I will show how to supply the solution ID for a number of SharePoint components, and also describe a work-around in a case where we cannot specify a solution ID.

Monday, November 14, 2011

How to update the assembly in sandboxed solutions

Sometimes we need to make changes to the assembly in a deployed SharePoint 2010 sandboxed solution. Perhaps we need to add something in an event receiver. Or perhaps we added a bug fix (not relevant - the code always works). Or some custom webpart needs to do something else than what it is doing right now.

The only problem is that the solution is deployed in a production environment. We can't just delete and recreate the site, then add the updated solution package, and then tell the users to start all over. So what do we do?

Not to worry: This is a piece of cake - and a small piece at that.

Tuesday, November 8, 2011

How to upload and download documents using the client object model

With the increasing popularity of SharePoint 2010, and especially after the introduction of Office365, the market for client applications for SharePoint is increasing. In response, Microsoft has released the SharePoint Client Object Model, which is a wrapper library for the SharePoint web services.

In this post I will demonstrate how you can use the Client Object Model (dare we use the abbreviation COM?) to upload and download files to and from SharePoint. This may prove a central operation if you are migrating an existing SharePoint site to Office365. Other scenarios include uploading an existing file store to document libraries in a local SharePoint farm, or creating plug-in's to existing applications that need to process your documents.

Friday, September 9, 2011

How to get language-specific field names in SharePoint 2010

In SharePoint 2010 you can access a site using different languages. Recently I had to synchronize list data with an external system, using the list field display names. Since the display name changed with the language, I had to make sure that the external system got the data in a specific language.

Friday, May 6, 2011

How to see the exception call stack in SharePoint 2010

SharePoint by default hides any erors that occur, instead displaying a friendly error message. However, during the development process, these error messages are rather unfriendly, since they prevent us from seeing what really goes on.