Synchronous versus a synchronous plug-ins

We can write two types of plug-in: synchronous and asynchronous. Synchronous plug-ins are most suited where you need to execute your business logic immediately—for example, implementing any calculation logic or integration with another system where you may want to bring an output parameter once data is integrated. Synchronous plug-ins keep the CRM platform busy until executed completely. Synchronous plug-ins also support transactions, which means that, if you are doing multiple actions in your plug-in, everything will either be committed successfully or rolled back in the event of an error:

Synchronous versus a synchronous plug-ins

The plug-in execution

Asynchronous plug-ins are well suited for any logic that can be executed in the background and is not required to show output immediately—for example, updating an entity based on another entity in background, sending e-mails, integrating data to another system where you don't need any output parameters, such as sending syncing billing information to ERP from CRM. Asynchronous plug-ins are executed by the asynchronous queue manager, so all the asynchronous plug-ins are queued under an asynchronous queue and executed one by one, or in parallel if multi-threaded.

But, while developing both synchronous and asynchronous plug-ins, we need to make sure we write code that executes faster. It should not take more than two minutes of execution time, which is the execution limit of plug-ins, otherwise the CRM execution platform will throw a time-out error.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.216.249