Is there any way to dynamically add metadata in the upload file. I am using the following code in this regard.
File uploadFile = context.Web.GetFileByServerRelativeUrl(location); //check out to make sure not to create multiple versions if (!list.ForceCheckout) uploadFile.CheckOut(); //setting metadata here uploadFile.ListItemAllFields["Status"] = "In-Progress"; uploadFile.ListItemAllFields.Update(); context.Load(uploadFile); context.ExecuteQuery(); //overwrite to make sure not to create multiple versions uploadFile.CheckIn(string.Empty, CheckinType.OverwriteCheckIn); context.Load(uploadFile); context.ExecuteQuery();
Upon running above code, i am getting this error:
Column 'Status' does not exist. It may have been deleted by another user.
Now is there any way to dynamically create it programmatically because i preferably don't want to create it using designer?