On Site Fields, is there a UpdateAndPushChanges option? #888
-
I'm slowly trying to upgrade/re-writing an old SharePointPnPCoreOnline C# code to use the latest pnp.core. Originally I had some code that updated the default value of the site column, this pushed the default value down to all the lists. Microsoft.SharePoint.Client.Field spfield = clientContext.Web.GetFieldByInternalName("myInternalName");
spfield.DefaultValue = "myDefaultValue";
spfield.UpdateAndPushChanges(true);
await clientContext.ExecuteQueryRetryAsync(); In my latest code, I can update the default value, but it doesn't push changes. await pnpContext.Web.LoadAsync(p => p.Fields,
p => p.ContentTypes.QueryProperties(p => p.Name,
p => p.FieldLinks.QueryProperties(p => p.Name, p => p.FieldInternalName)));
var field = pnpContext.Web.Fields.AsRequested().FirstOrDefault(p => p.InternalName == "myInternalName");
field.DefaultValue = "myDefaultValue";
await field.UpdateAsync(); Is this a feature that doesn't exist, or am I missing a command? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
@pmatthews05 : this is something we don't have today, but I'll add a work item to get this added. SharePoint REST is not offering an option for this but via Graph or CSOM this is possible. Most likely will follow the Graph approach here. |
Beta Was this translation helpful? Give feedback.
@pmatthews05 : this is something we don't have today, but I'll add a work item to get this added. SharePoint REST is not offering an option for this but via Graph or CSOM this is possible. Most likely will follow the Graph approach here.