0

I have the following program. I've developed a synchronous event receiver (ItemUpdating) which is executed when a list item is being changed. I've run into the situation where the code in my event receiver is being executed, but under certain circumstances the user might get a saving conflict.

In this scenario my code has already being executed while the assumptions inside the event receiver where wrong, because of the saving conflict.

Is there any way to programmatically detect if will be occuring? Sorry if my explanation wasn't too good, but english is not my mother tounge. This is a SharePoint 2013 Standard Server.

4
  • What are the events ? item adding ? item updating ? Commented Feb 20, 2020 at 9:26
  • ItemUpdating is the event receiver i'm using
    – Andreas
    Commented Feb 20, 2020 at 10:26
  • SharePoint version ? Commented Feb 20, 2020 at 10:58
  • 2013 on premises Standard, updating both into my initial question
    – Andreas
    Commented Feb 20, 2020 at 11:01

1 Answer 1

0

Try use Enable/disable to prevent multiple eventfiring, in your item updating function. do not have multiple update calls.

example:

this.DisableEventFiriing(); 
item.SystemUpdate(false); 
this.EnableEventFiring();
3
  • Please re read my question. I'm not trying to prevent the event being fired. I want to programmatically find out if a saving conflict will occur after ItemUpdating has been executed.
    – Andreas
    Commented Feb 20, 2020 at 12:50
  • if you update your code, then it will prevent multiple eventfiring and this would avoid save conflict. This might be the reason for your save conflicts. Commented Feb 20, 2020 at 13:04
  • The saving conflict is not caused by my event receiver and rather a service which is published and might be called and executed while an employee is working on a list item, therefor a conflict happens. Thanks for your help anyway!
    – Andreas
    Commented Feb 20, 2020 at 13:34

Your Answer

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

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