Hi All,
I am getting Version Conflict Error in SharePoint Document Library while update multiple columns in Event Receiver using CSOM.
I have created event receiver in document library "ItemAdded". I will read the Bar code from the uploaded image. The Bar Code contains JSON value. I will read the JSON and assign in to datatable. I will loop the datatable and update the values in to document library columns one by one.
The document library contains 20 columns. The JSON may not contains the values for all the columns. So i am looping datatable one by one and update the values to only the available column.
DataTable dsdata = JsonConvert.DeserializeObject<DataTable>(strExtractJSONData); for (int i = 0; i < dsdata.Columns.Count; i++){
try
{
itemDemoEventReceiver[dsdata.Columns[i].ColumnName.Replace(" ", "_x0020_")] = dsdata.Rows[0][i].ToString();
itemDemoEventReceiver.Update();
clientContext.ExecuteQuery();
}
catch(Exception ex)
{
}
}
Regards
Suresh