Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Using REST with External Content types

$
0
0

hi,

when retrieving a contenttype field that uses a external list for data, you get this

- <m:properties><d:CanBeDeleted m:type="Edm.Boolean">true</d:CanBeDeleted> <d:DefaultValue m:null="true" /> <d:Description /> <d:Direction>none</d:Direction> <d:EnforceUniqueValues m:type="Edm.Boolean">false</d:EnforceUniqueValues> <d:EntityPropertyName>ClientName</d:EntityPropertyName> <d:Filterable m:type="Edm.Boolean">true</d:Filterable> <d:FromBaseType m:type="Edm.Boolean">false</d:FromBaseType> <d:Group>development</d:Group> <d:Hidden m:type="Edm.Boolean">false</d:Hidden> <d:Id m:type="Edm.Guid">c244ca38-ce19-4a91-bf99-42c94e90790d</d:Id> <d:Indexed m:type="Edm.Boolean">false</d:Indexed> <d:InternalName>ClientName</d:InternalName> <d:JSLink /> <d:ReadOnlyField m:type="Edm.Boolean">false</d:ReadOnlyField> <d:Required m:type="Edm.Boolean">false</d:Required> <d:SchemaXml><Field Type="BusinessData" DisplayName="ClientName" Required="FALSE" EnforceUniqueValues="FALSE" Group="development" ID="{c244ca38-ce19-4a91-bf99-42c94e90790d}" SourceID="{368a9ae5-c804-4f34-bf62-14e2a453e18a}" StaticName="ClientName" Name="ClientName" Version="7" Customization="" BaseRenderingType="Text" ColName="nvarchar12" RowOrdinal="0" SystemInstance="cwUtil" EntityNamespace="http://<serverurl>" EntityName="clients" BdcField="ClientName" Profile="" HasActions="False" SecondaryFieldBdcNames="0" RelatedField="clients_ID" SecondaryFieldWssNames="0" RelatedFieldBDCField="" RelatedFieldWssStaticName="clients_ID" SecondaryFieldsWssStaticNames="0" AddFieldOption="AddFieldInternalNameHint" /></d:SchemaXml> <d:Scope>/Client Documents</d:Scope> <d:Sealed m:type="Edm.Boolean">false</d:Sealed> <d:Sortable m:type="Edm.Boolean">true</d:Sortable> <d:StaticName>ClientName</d:StaticName> <d:Title>ClientName</d:Title> <d:FieldTypeKind m:type="Edm.Int32">0</d:FieldTypeKind> <d:TypeAsString>BusinessData</d:TypeAsString> <d:TypeDisplayName>External Data</d:TypeDisplayName> <d:TypeShortDescription>External Data</d:TypeShortDescription> <d:ValidationFormula m:null="true" /> <d:ValidationMessage m:null="true" /> <d:MaxLength m:type="Edm.Int32">255</d:MaxLength> </m:properties>

the source for the column is in the schemaXml field

<d:SchemaXml><Field Type="BusinessData" DisplayName="ClientName" Required="FALSE" EnforceUniqueValues="FALSE" Group="development" ID="{c244ca38-ce19-4a91-bf99-42c94e90790d}" SourceID="{368a9ae5-c804-4f34-bf62-14e2a453e18a}" StaticName="ClientName" Name="ClientName" Version="7" Customization="" BaseRenderingType="Text" ColName="nvarchar12" RowOrdinal="0" SystemInstance="cwUtil" EntityNamespace="http://<serverurl>" EntityName="clients" BdcField="ClientName" Profile="" HasActions="False" SecondaryFieldBdcNames="0" RelatedField="clients_ID" SecondaryFieldWssNames="0" RelatedFieldBDCField="" RelatedFieldWssStaticName="clients_ID" SecondaryFieldsWssStaticNames="0" AddFieldOption="AddFieldInternalNameHint" /></d:SchemaXml>

is there a way to get the entitynamespace and entityname without having to parse this xml structure?

I believe the entitynamespace is giving me the location where the lists is hosted ,  the entityname is giving me the list name and the field I want is in the staticname properties

the field value seems to be stored on the item as a simple property like a string.

what does the SourceID property refer to? I thought I might be able to use that to retrieve all the available choices for the lookup.

mrP


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>