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 have a ListTemplate which is being deployed with Visual Studio.

Is it possible to make a reference from this template to an external content type that runs on the farm? Or must I manually add these columns within the SharePoint UI?

I've saved the list as a template, and looking at the relevant <Field> tags in the extracted manifest.xml gives me:

<Field Type="BusinessData"
    DisplayName="Staff ID"
    Required="FALSE"
    ID="{c56a95c8-b5f4-4e83-8eb9-eb75743f8837}"
    SourceID="{6db0b01d-3673-435d-93d6-c7d7d3757185}"
    StaticName="Staff_x0020_ID"
    BaseRenderingType="Text"
    Name="Staff_x0020_ID"
    ColName="nvarchar12"
    RowOrdinal="0"
    SystemInstance="People"
    EntityNamespace="People"
    EntityName="Staff"
    BdcField="StaffID"
    Profile="/_layouts/ActionRedirect.aspx?EntityNamespace=Mwe%2ESharePoint%2EStaffInfo%2EPeople&amp;EntityName=Staff&amp;LOBSystemInstanceName=People&amp;ItemID="
    HasActions="True"
    SecondaryFieldBdcNames="(trim)"
    RelatedField="Staff_ID"
    SecondaryFieldWssNames="(trim)"
    RelatedFieldBDCField=""
    RelatedFieldWssStaticName="Staff_ID"
    SecondaryFieldsWssStaticNames="(trim)"
    AddFieldOption="AddToDefaultContentType, AddFieldToDefaultView"
    Version="1"/>


<Field Type="Note"
    DisplayName="Staff_ID"
    Hidden="TRUE"
    ReadOnly="TRUE"
    BdcField="Staff_ID"
    ID="{26213047-a755-412f-98f5-6c2492c863b6}"
    SourceID="{6db0b01d-3673-435d-93d6-c7d7d3757185}"
    StaticName="Staff_ID"
    Name="Staff_ID"
    ColName="ntext2"
    RowOrdinal="0"/>

The problem is, when I try to put this into my List Template's Elements.xml in the project/solution it fails with pretty much every one of the attributes in the BusinessData-typed Field.

share|improve this question
add comment

1 Answer 1

I've found this question when searching for a solution to a related problem with Caml defined lookup columns that map to bcs entities, so I am leaving this notice hoping it may be useful to future viewers.

Based on this reference from Microsft forums it would seem that the default schema for caml declarations in SharePoint does not include some of the attribute needed to declare a bcs related lookup.

The above post suggests to modify the wss.xsd file located at c:\Program Files\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\XML - this seems to bypass the errors (on a similar project, we weren't able to deploy the solution and activate the features until this mod was made). That said, I suspect that doing so would put you in an unsupported scenario... also notice that even with this mod I still wasn't able to create a fully functional lookup.

Also notice this post that provides a programmatic approach to the problem: here. Even in this case though the poster seems to be experiencing random outputs....

share|improve this answer
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.