There are a lot of other discussions on
AllowUnsafeUpdates, but none mention SharePoint Online. Is
AllowUnsafeUpdates available in SharePoint Online? If not, are there alternatives or manual actions to achieve the same? Thank you.
AllowUnsafeUpdates property is not available in CSOM.
There are no alternatives for that as well.
To update author column as per your comment, you can try something as below:
Microsoft.SharePoint.Client.User user = context.Web.EnsureUser("i:0#.f|membership|[email protected]"); context.Load(user); context.ExecuteQuery(); FieldUserValue userValue = new FieldUserValue(); userValue.LookupId = user.Id; listItem["Author"] = userValue; listItem.Update(); context.ExecuteQuery();
Silly as it sounds, excellent code by @Gautam Sheth does not work. Please explore this answer for a weird hack necessary to update Author info in addition to valid code provided here. I refused to believe my eyes reading this. But yes, it works. All credits to original author.