I am trying to get the field info of a list and I need to also know whether the field has Enforce unique values: as true.

IEnumerable<List> lists = clientContext.LoadQuery( lists.Include(list =>
list.Title, list => list.Id, list => list.DefaultViewUrl, list => list.BaseType,
list => list.SchemaXml).Where( list => (list.Title == listName)));

lists = clientContext.ExecuteQuery();
List required = lists.FirstOrDefault()

if i go through the required.SchemaXml then i find the following details on the fields

<Field ID="{03e45e84-1992-4d42-9116-26f756012634}" RowOrdinal="0" Type="ContentTypeId" Sealed="TRUE" ReadOnly="TRUE" Hidden="TRUE" DisplayName="Content Type ID" Name="ContentTypeId" DisplaceOnUpgrade="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="ContentTypeId" ColName="tp_ContentTypeId" FromBaseType="*TRUE" />

In the Details info on unique constrain is not present.

How to retrieve the unique constraint value?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.