Dynamics 365 2 minutes plugin time out workaround:
Plugin or custom workflow activity run in isolation mode "sandbox" will have hard limit 2 minutes. In case your plugin is complex and need more than 2 minutes, there are some workaround for this.
For CRM onpremise
- Change plugin isolation mode to "None"
- Open registry editor and change some values (in CRM server)
HKEY_LOCAL_MACHINE\Software\Microsoft\MSCRM\SandboxClientOperationTimeoutInSec as a REG_DWORD key with a value in decimal greater than 120 (default is 120, which is equivalent to 2 minutes).
HKEY_LOCAL_MACHINE\Software\Microsoft\MSCRM\SandboxHostOperationTimeoutInSec as a REG_DWORD key with a value in decimal greater than 120 (default is 120, which is equivalent to 2 minutes).
HKEY_LOCAL_MACHINE\Software\Microsoft\MSCRM\SandboxWorkerOperationTimeoutInSec as a REG_DWORD key with a value in decimal greater than 120 (default is 120, which is equivalent to 2 minutes).
HKEY_LOCAL_MACHINE\Software\Microsoft\MSCRM\OleDbTimeout as a REG_DWORD key with a value in decimal. Note The value of 600 represents 600 seconds. By default, the value is 30 seconds. You may need to set this to 86400 which is equivalent to a value of 24 hours.
- Change Web.config in CRM server
- Open C:\Program Files\Dynamics 365\CRMWeb\Web.config in CRM server
- Change the attribute httpRuntime executionTimeout="86400" (means 24h), default value is 300 means 5 mins
- If your plugins can not run in mode "Sandbox", you can move the logic of the plugin to custom workflow activity, then you can run the workflow on demand or automatically with the trigger same as filtering attributes in plugin then try to run the wokflow in mode "None"
For CRM online
We can not change registry or web.config in CRM online. There are some workaround solutions:
- Move the whole logic of the plugin to Azure Function, then call Azure Function in the plugin.
- Move the whole logic of the plugin to a shedule job (console application), then setup this job run every some minutes. If you have a server, you can use window task scheduler or you can run it in Azure
Add new comment