Friday, 16 September 2011

British pound Sterling sign (£) in xml causes error

British pound Sterling sign (£) in xml causing an error? Try this:

<?xml version="1.0" encoding="ISO-8859-1"?>
 

Thursday, 15 September 2011

Using a custom task list template for a Workflow task list

In Visual Studio I created a custom content type, a custom task list template and a custom list instance using the template, but couldn't get this list to appear in the task list when trying to add a new Workflow in the SharePoint UI.

The problem turned out to be my use of the wrong value for the 'Type' attribute of the <ListTemplate> element in my list definition. When creating a workflow you are only able to select task lists with Type="107". The Elements.xml file should look some like this:

<ListTemplate
        Name="CustomTasks"
        Type="107"
        BaseType="0"
        OnQuickLaunch="TRUE"
        SecurityBits="11"
        Sequence="360"
        DisplayName="Custom Tasks"
        Description="Custom Tasks"
        Image="/_layouts/images/ittask.png"/>

Monday, 12 September 2011

SharePoint base content type ID list

NameID
System0x
Item0x01
Document0x0101
Event0x0102
Issue0x0103
Announcement0x0104
Link0x0105
Contact0x0106
Message0x0107
Task0x0108
Workflow History0x0109
Post0x0110
Comment0x0111
East Asia Contact0x0116
Folder0x0120

Wednesday, 7 September 2011

Specifying a namespace in SPMetal generated entities files

Today I generated two entities.cs files using SPMetal without specifying namespaces, and was met with a whole host of ambiguity errors, such as
Ambiguity between 'Item._entityState' and 'Item._entityState'
Deleting my files and re-running SPMetal, this time specifying different namespaces for each file, resolved the problem:
SPMetal /web:http://mysite/myweb /code:C:\Projects\MyProject\MyEntities.cs /namespace:MyExampleNamespace