In this post I am going to explain one major issue with Event receiver asynchronous events.
I have one event called
public override void ItemUpdated(SPItemEventProperties properties)
The above is an asynchronous even , that means if you have 5 methods inside the event , it doesnot execute sequentially , if method1 takes some time to execute and method2 is dependant on method1 , it doex not wait to execute method2 to excute until method1 finishes.
In my scenario , I want to convert Word Document to PDF in Method1 and then email to members with attachment of the generated pdf in method2 . But the program sends email without attachment because method1 takes time to generate pdf.
So the solution is , convert the ItemUpdated event from Asynchronous to Synchronous , so it will execute sequentially.
So . go to your Elements.xml
Add the below line in
Here is the complete code