Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

In Plugin development - when to select "Sync" and "Async" option?

Posted on by 75

Hello,

Can you please share - In Plugin development - when to select "Sync" and "Async" option? If you could provide the example scenario will be greatly appreciated!

Thanks,

  • Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    RE: In Plugin development - when to select "Sync" and "Async" option?

    Hi TomSD365,

    Such as, Asynchronous processing of cascading transactions.

    By default, cascading operations are performed as a synchronous transaction. For a synchronous cascading transaction, all impacted records are identified by the system. As the records are processed, they are locked by the system. Once all the changes have been completed, the records are unlocked, and the transaction is completed.

    Synchronous transactions with a large number of records can cause performance issues for environments when long running transactions fail due to server timeouts. The records are locked preventing other jobs and user transactions that operate on the same records from executing. Also, long running transactions might result in a backlog of pending transactions and requests that decrease system performance and might cause work stoppage.

    If an environment is encountering timeouts or degraded performance while the synchronous cascading operations are in progress, your environment could benefit by enabling the asynchronous mode.

    https://learn.microsoft.com/en-us/power-platform/admin/async-cascading

  • TomSD365 Profile Picture
    TomSD365 75 on at
    RE: In Plugin development - when to select "Sync" and "Async" option?

    Hi Haig Liu

    Thank you for your email - can you please provide an examples for Sync and Async in terms of Dynamics 365 functionality?

    Thanks,

  • Suggested answer
    Haig Liu Profile Picture
    Haig Liu Microsoft Employee on at
    RE: In Plugin development - when to select "Sync" and "Async" option?

    Hi TomSD365,

    About synchronization and asynchrony.

    The most common situation I encounter is timeout occur when a large number of records are created or imported.

    At this time, I would recommend asynchrony.

    Create Sync plugins means user should wait until finish process the step, but you can be sure all action done.

    Create Async step means user invoke the action and continue with other task, in the same time CRM with Asynchronous Service run the action when it can be done…

  • Verified answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: In Plugin development - when to select "Sync" and "Async" option?

    Hello,

    The main difference between sync and async plugins is that sync plugins are executed within the execution pipeline (SQL Analogy to a transaction) so if the plugin raises an exception the transaction is rolled back. The typical scenario - let's say a user wants to see the result immediately after the save operation is performed - for example, the autoincrement of the record or pre-population of fields based on the data user populated on the form.

    The Async plugin is executed asynchronously and doesn't cause immediate change to the data. The typical scenario for such operations - is any long-running operations that do not require immediate visibility for a user. It might be communication to the external systems or anything else that might take time to be executed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans