2 minute read

On a current project I'm working on we found a strange behavior problem with the Rest services of SharePoint.

When you create a normal list (custom list or whatever list you want) you can open the list by using the ListData service like this:

http://portal.development.com/_vti_bin/ListData.svc/TestList/

When you navigate to this page you will see a RSS like representation of the the list what actually is a XML response of the service:

DataService

The problem occurs when we add a type of column to the list. Lets add a column of the type calculated field and call it test calculation. As data type we will take single line of text and add a calculation to calculate the length of the title like Len([Title]).

If we navigate to the ListData service we will see that the page is still the same like the above screenshot. When we look at the XML we will see that the Test calculation field is available in the XML.

<entry m:etag="W/&quot;1&quot;">
    <id>http://portal.development.com/_vti_bin/ListData.svc/TestList(1)</id>
    <title type="text">Test</title>
    <updated>2011-01-11T07:58:56+01:00</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="TestListItem" href="TestList(1)" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/CreatedBy" type="application/atom+xml;type=entry" title="CreatedBy" href="TestList(1)/CreatedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ModifiedBy" type="application/atom+xml;type=entry" title="ModifiedBy" href="TestList(1)/ModifiedBy" />
    <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Attachments" type="application/atom+xml;type=feed" title="Attachments" href="TestList(1)/Attachments" />
    <category term="Microsoft.SharePoint.DataService.TestListItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:ContentTypeID>0x010005A0A71B03FA954DB854B647353C250C</d:ContentTypeID>
        <d:Title>Test</d:Title>
        <d:TestCalculation>4.00000000000000</d:TestCalculation>
        <d:Id m:type="Edm.Int32">1</d:Id>
        <d:ContentType>Item</d:ContentType>
        <d:Modified m:type="Edm.DateTime">2011-01-11T07:58:56</d:Modified>
        <d:Created m:type="Edm.DateTime">2011-01-11T07:58:56</d:Created>
        <d:CreatedById m:type="Edm.Int32">1</d:CreatedById>
        <d:ModifiedById m:type="Edm.Int32">1</d:ModifiedById>
        <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
        <d:Version>1.0</d:Version>
        <d:Path>/Lists/TestList</d:Path>
      </m:properties>
    </content>
  </entry>

Now we change the formula of the calculation field to =LEN([TITLE]) = 5 and change the type to Yes/No. In the representation of the list we see that everything is working like it supposed to:

list

Now lets open the ListData Service and you will notice what I meant with the problem within the ListData service. You will get a Internal Server error like below:

InternalServerError

Even if we change the formula to a very simple formula like =Yes the ListData service will still fail. I hope Microsoft will solve this problem in the first Service Package and till then we will just have to work around the problem.