0

I have a Document Library with custom content type. One of the columns is "Multiline lines of text" and 'append only to existing text' feature is activated. Problem is that when there is a new version of the item, it always creates a new comment with the value of the last one. There is no code written about this field, only a event receiver with notification role. Any ideas what could cause the problem?

approver = approverChoice[0].DisplayText;                          
item["Approver"] = web.EnsureUser(approver);
item.Update();
web.AllowUnsafeUpdates = false;

1 Answer 1

0

This should not happen, I just checked this scenario it is working correctly. It is only appending when we are making change to that particular field.

Somehow your comment column is also getting updated via code, try to edit using OOTB forms..If you are creating new version via code(though not updating comment column). please share code piece, there must be something wrong in code which is updating this column.

6
  • I am using application page which is updating people picker column and sending mail to the new user and I am updating the item with .Update(). The interesting fact is that if I do a change to some property with Edit Item, after that this scenario with the duplicated comment with every version disappears. The code is simple, just taking the value from people picker field and setting the property of the item to be this user. I provided the short code snippet. Jun 10, 2019 at 8:22
  • I tried just for the case with SystemUpdate(true) and it is not causing problems, but sadly can't use it because modified by, modified at columns need to be updated due to client needs. Jun 10, 2019 at 8:53
  • okay..seems to be bug then..can you try one thing If i can suggest a weird way...get item again after people picker column is updated and perform a blank update again....not sure if it will work...just throwing arrows in air.. Jun 10, 2019 at 9:11
  • Tried it. It is doing now 2 duplicates. So item.Update() is causing this. If we use Edit Item and after that it is not happening. I guess it's just a SharePoint bug. Jun 10, 2019 at 10:02
  • let me try this..which version of sharepoint ? Jun 10, 2019 at 10:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.