Event Reciver -> Convert Asynchronous event to Synchronous

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

<Synchronization>Synchronous</Synchronization>

Here is the complete code

<Receiver>

<Name>AgendaMeetingEventReceiverItemUpdated</Name>

<Type>ItemUpdated</Type>

<Assembly>$SharePoint.Project.AssemblyFullName$</Assembly>

<Class>CommitteeManagementSystem.AgendaMeetingEventReceiver.AgendaMeetingEventReceiver</Class>

<SequenceNumber>10000</SequenceNumber>

<Synchronization>Synchronous</Synchronization>

</Receiver>

Thank you

22 thoughts on “Event Reciver -> Convert Asynchronous event to Synchronous

  1. college degrees

    Having read this I thought it was very informative. I appreciate you taking the time and effort to put this information together. I once again find myself spending a lot of time both reading and commenting. But so what, it was still worth it!

  2. college degrees

    Hello I am so glad I found your web site, I really found you by accident, while I was searching on Askjeeve for something else, Anyhow I am here now and would just like to say kudos for a incredible post and a all round exciting blog (I also love the theme/design), I don’t have time to read it all at the minute but I have book-marked it and also added your RSS feeds, so when I have time I will be back to read a lot more, Please do keep up the fantastic b.|

  3. education advice

    Simply desire to say your article is as astonishing. The clarity in your post is simply spectacular and i could assume you are an expert on this subject. Fine with your permission allow me to grab your RSS feed to keep updated with forthcoming post. Thanks a million and please keep up the gratifying work.

  4. career guidance

    Howdy, i read your blog from time to time and i own a similar one and i was just wondering if you get a lot of spam remarks? If so how do you protect against it, any plugin or anything you can advise? I get so much lately it’s driving me insane so any help is very much appreciated.

  5. stock prices

    Hi I am so happy I found your blog page, I really found you by mistake, while I was browsing on Bing for something else, Nonetheless I am here now and would just like to say kudos for a marvelous post and a all round exciting blog (I also love the theme/design), I don’t have time to browse it all at the moment but I have book-marked it and also added in your RSS feeds, so when I have time I will be back to read a great deal more, Please do keep up the great jo.|

  6. education college

    I feel this is among the most significant information for me. And i’m happy reading your article. But should statement on some common issues, The website style is ideal, the articles is in point of fact great : D. Excellent process, cheers

  7. college tips

    magnificent issues altogether, you simply won a brand new reader. What may you suggest in regards to your put up that you just made some days in the past? Any positive?

  8. homeschooling

    What’s Going down i am new to this, I stumbled upon this I’ve discovered It absolutely useful and it has helped me out loads. I’m hoping to give a contribution & assist other customers like its helped me. Good job.

  9. educational websites

    I was pretty pleased to uncover this great site. I need to to thank you for your time just for this wonderful read!! I definitely loved every bit of it and i also have you saved to fav to look at new information in your website.

  10. college education

    Good day very cool site!! Guy .. Beautiful .. Superb .. I’ll bookmark your website and take the feeds additionally? I am happy to seek out so many useful info here in the post, we’d like work out extra techniques on this regard, thank you for sharing. . . . . .

  11. online education degrees

    Hello! This is my first visit to your blog! We are a collection of volunteers and starting a new project in a community in the same niche. Your blog provided us valuable information to work on. You have done a extraordinary job!

  12. education tips

    Awesome website you have here but I was curious if you knew of any discussion boards that cover the same topics discussed here? I’d really like to be a part of community where I can get feed-back from other experienced individuals that share the same interest. If you have any suggestions, please let me know. Kudos!|

Leave a Reply

Your email address will not be published. Required fields are marked *