Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to create a List template definition declaratively (using CAML) which includes a External Data column and several secondary columns.

I created a custom list via the UI and exported the schema XML, trimmed out everything I didn't need, and that worked. I was able to install that schema and declaratively provision new list instances based on it.

However, when I tried to create & deploy a new list template definition from scratch, based on what I'd learned, it fails with a Failed to do column assignments for list "List Name" error in the ULS log. All that's really different is the LOB system, BDC model, field names, and view definitions.

Here is the XML for the list template; please advise as to what you see wrong. I cannot find any meaningful difference between this schema and the one that works.

<List xmlns:ows="Microsoft SharePoint"
      xmlns="http://schemas.microsoft.com/sharepoint/"
      Title="Publications"
      EnableContentTypes="FALSE"
      FolderCreation="FALSE"
      ModeratedList="TRUE"
      DraftVersionVisibility="2"
      DisableAttachments="TRUE"
      Direction="$Resources:Direction;"
      Url="Lists/PublicationsListTemplate"
      BaseType="0">
  <MetaData>
    <ContentTypes>
      <ContentTypeRef ID="0x01">
        <Folder TargetName="Item" />
      </ContentTypeRef>
    </ContentTypes>
    <Fields>
      <Field Type="BusinessData"
             DisplayName="News Item"
             Required="TRUE"
             ID="{3E43E68F-D992-42ED-B1E3-083AA0211297}"
             StaticName="News_x0020_Item"
             Name="News_x0020_Item"
             BaseRenderingType="Text"
             SystemInstance="{system instance}"
             EntityNamespace="{entity namespace}"
             EntityName="{entity name}"
             BdcField="Title"
             Profile="/_layouts/ActionRedirect.aspx?EntityNamespace={entity namesapce}&amp;EntityName={entity name}&amp;LOBSystemInstanceName={system instance}&amp;ItemID="
             HasActions="True"
             SecondaryFieldBdcNames="3%207%2013%2018%20ID%20Source%20Organization%20PublicationStatus%2010"
             RelatedField="NewsItemsAggregatorItemID"
             SecondaryFieldWssNames="14%207%2017%2033%20Item_x0020_ID%20Source%20Source_x0020_Org%20Source_x0020_Publish_x0020_Statu%2011"
             RelatedFieldBDCField=""
             RelatedFieldWssStaticName="NewsItemsAggregatorItemID"
             SecondaryFieldsWssStaticNames="14%207%2017%2033%20Item_x0020_ID%20Source%20Source_x0020_Org%20Source_x0020_Publish_x0020_Statu%2011"/>
      <Field Type="Note" DisplayName="NewsItemsAggregatorItemID" StaticName="NewsItemsAggregatorItemID" Name="NewsItemsAggregatorItemID" Hidden="TRUE" BdcField="ID" ID="{895E0330-957F-4893-837B-2168D43F2328}" ReadOnly="TRUE"/>
      <Field Type="Note" DisplayName="Item ID" StaticName="Item_x0020_ID" Name="Item_x0020_ID" BdcField="ID" ID="{1CD44DF3-80B7-4C61-B78E-774FA768559C}" ReadOnly="TRUE" />
      <Field Type="Note" DisplayName="Source" StaticName="Source" Name="Source" BdcField="Source" ID="{44E04BA2-4A41-4566-93CF-5015B500AE2C}" ReadOnly="TRUE"/>
      <Field Type="Note" DisplayName="Source Org" StaticName="Source_x0020_Org" Name="Source_x0020_Org" BdcField="Organization" ID="{B7C90E67-089D-4030-AFE6-5A027D1BABB8}" ReadOnly="TRUE"/>
      <Field Type="Note" DisplayName="Source Publish Status" StaticName="Source_x0020_Publish_x0020_Statu" Name="Source_x0020_Publish_x0020_Statu" BdcField="PublicationStatus" ID="{D6B9BCC1-33E5-4FB7-A34F-EBE9E9C6928C}" ReadOnly="TRUE"/>
    </Fields>
    <Views>
      <!--snip-->
    </Views>
    <Forms>
      <!--snip-->
    </Forms>
  </MetaData>
</List>
share|improve this question
add comment

1 Answer

I don't know if this is your only issue, but it seems to me like your SecondaryFieldBdcNames and SecondaryFieldWssNames attributes have been encoded too many times.

These should be a list of the additional fields that you wish to bring through, separated by :.

So in your situation, it appears as if this should be:

SecondaryFieldBdcNames="ID:Source:Organization:PublicationStatus"
SecondaryFieldWssNames="Item_x0020_ID:Source:Source_x0020_Org:Source_x0020_Publish_x0020_Statu"

I hope this helps...

share|improve this answer
    
The colon-delimited format was true for MOSS 2007, but in SP 2010 it uses a different format. –  Rex M Jun 14 '12 at 7:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.