Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to set RelationshipDeleteBehavior on a list using a site column and content type programatically CSOM c#

$
0
0

On Prem development machine, I'm writng a deployment routine in c# using the client object model.  I've created some site columns of type Lookup, I've created a content type and added those lookup columns to it and I've created a list using the content type.  I want to set the RelationshipDeleteBehavior property on some of the lookup columns in the list.  I'm also using the 16 assemblies.

List list = cc.Web.GetListByTitle("MyList");
cc.Load(list);
cc.ExecuteQuery();
Field f = list.Fields.GetByInternalNameOrTitle("MyLookupField");
cc.Load(f);
cc.ExecuteQuery();
(fasFieldLookup).RelationshipDeleteBehavior =RelationshipDeleteBehaviorType.Restrict;

f is returning as a Field but (fasFieldLookup) is returning null here.  Any insight on this?

Thank you.


Dan Budimir



Viewing all articles
Browse latest Browse all 7589

Trending Articles



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