Declarative Lookup field to external list but no datapicker shown?

Hi,

I am using an own site Feature deploy with it my Content types. I manage to create a lookup field to my external list. Everything works fine. Its getting deployed and is shown as lookup in the site column.

At the document libery I am only able to select the data through a pull down menu (data is correct in the pull down) but I have now a pull down list with 20.000 items. I would like to have the data picker.

When I create the look up column through the create button in site columns it is also working but as a type it is "external data" and I also get the data picker.

What do I miss to declare programmatically?

My working testcode:

  <Field ID="{FCA62BC9-AB0E-428F-96DC-98F1D706F60E}"
     Type="Lookup"
     SourceID="http://schemas.microsoft.com/sharepoint/v3"
     DisplayName="BusinessEntityID"
     Required="TRUE"
     List="6c2d7a82-4f86-445d-afb7-dfc9c5131255"
     ShowField="BusinessEntityID"
     UnlimitedLengthInDocumentLibrary="FALSE"
     Overwrite="TRUE"
     Group="Costume Fields"
     StaticName="BusinessEntityID"
     Name="BusinessEntityID" />

May 25th, 2015 11:29am

Hi,

Based on your description, my understanding is that you want to have a look up field to pick up the data from external list.

In the case, if you want to have the data picker for selecting the data, I suggest you can refer the steps in the article below:

Creating SharePoint lookups which get their data from a lookup table in SQL

If I have something misunderstood about the data picker, please response for that.

Thanks

Best Regards

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2015 1:59am

Hello,

You understand it right. But I think my way was wrong. I think I need to find out how to use the Type="BusinessData". Would you have a suggestion on how to do it with this type?

Thanks,

King Regards Robert

May 26th, 2015 3:25am

You have to create hidden column first. Then refer the Bdc field in the hidden column.

Then create the column with External content type details. A sample CAML markup is here

<Field Type="Note" DisplayName="EMP_DB_ID" Hidden="TRUE" ReadOnly="TRUE" 
       BdcField="EMP_DB_ID" ID="{aae1ccce-fbe0-44f9-8f1e-c218abbb28e8}"
       SourceID="{516c3760-c6ce-4c90-b7fc-fbebee275f30}" StaticName="EMP_DB_ID1" Name="EMP_DB_ID1" />
<Field Type="BusinessData" DisplayName="Employee" 
       Required="FALSE" EnforceUniqueValues="FALSE" 
       Group="Custom Columns" ID="{31025ab9-c3bc-4655-b893-87346c29017d}"
       SourceID="{516c3760-c6ce-4c90-b7fc-fbebee275f30}" StaticName="Employee" 
       Name="Employee" SystemInstance="DEV" EntityNamespace="http://sharp/hfd"
       EntityName="EMP_DB" BdcField="firstname" Profile="" HasActions="True"
       SecondaryFieldBdcNames="0" RelatedField="EMP_DB_ID1" SecondaryFieldWssNames="0" RelatedFieldBDCField="" 
       RelatedFieldWssStaticName="EMP_DB_ID1" SecondaryFieldsWssStaticNames="0" 
       AddFieldOption="AddFieldInternalNameHint" Version="1" />

Free Windows Admin Tool Kit Click here and download it now
May 26th, 2015 3:33am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics