locked
MS CRM 2011: Need workaround for plugin execution time limit of 2 minutes RRS feed

  • Question

  • Hi,

    I've a situation where there is a sync plugin on account entity which gets triggered on GRANT, REVOKE AND MODIFY ACCESS messages. It basically retrieves all Opportunities, Contacts, Leads and a custom entity records associated with this account record and performs GRANT/REVOKE/MODIFY operation on all the associated records.

    Since account has got large number of associated opportunity/contact/leads/custom entity records, the plugin is exceeding the limit of 2 minutes during execution and leaving behind the 'Timeout' exception. Whether a plugin executes synchronously or asynchronously, there is a 2 minute time limit imposed on the execution of a message request.

    Also I am not sure if the custom workflow activity could help resolve this issue.

    Any thoughts / suggestions / views are all welcome!

    Thank you!
    Abhi


    • Edited by Abhi D Thursday, May 22, 2014 9:14 AM
    Thursday, May 22, 2014 9:12 AM

All replies

  • Custom workflow activities have the same 2 minutes limitation

    My blog: www.crmanswers.net - Rockstar 365 Profile

    Thursday, May 22, 2014 9:32 AM
  • Ok. Is there any other option by which we can accommodate the above requirement?
    • Edited by Abhi D Thursday, May 22, 2014 10:03 AM
    Thursday, May 22, 2014 10:02 AM
  • Hi Abhi,

    I also faced the same issue but then I have separate all the code into two sections.

    1. Plugin

    2. .NET console application

    And call the console application using thread and it solves my issue.

    One more option is there but i dont know it will solve your issue or not I didn;t try this because its an unsupported customization

    http://crmbusiness.wordpress.com/2011/06/14/crm-2011-where-to-find-the-timeout-settings-which-effect-crm/

    Note: Both solutions will work only onpremise system


    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
    Mubasher Sharif
    Check out my about.me profile!
    http://mubashersharif.blogspot.com
    Linked-In Profile
    Follow me on Twitter!

    Thursday, May 22, 2014 10:32 AM
  • Hi Mubasher,

    The solution provided above makes sense to me. However would like to know that in your case when you used this approach, does plugin execution have to wait till the time thread executing the console app is running?

    Or in other words, do we need below statement while calling console app from plugin code?:

    process.WaitForExit();

    Thanks,
    Abhi

    Thursday, May 22, 2014 10:54 AM
  • Hi. 

    This is the maximum limit of plugin , custom workflow etc. Because crm handles it from db level. İf 2 minutes is not enough for you , i think your plugin or process design set up wrong. Believe me ı worked millions of data and never faced with that problem.

    For ex ; in a real life project example , ı have millions of appointments related to this account. I can easily get the appointments in account update messages using LİNQ. 

    Last warning is that you want to retrieve this records in plugin itself right? While plugin is running , u can not retrieve this account from another dll , or wcf service.Because crm locks the records.

    I hope this helps , but there is no way to change this timeout with supported way. 


    Thursday, May 22, 2014 2:37 PM
  • Hi Polat,

    Thanks for the information. Well, the plugin code has been written by someone else and actually haven't reviewed the code yet. Will check to see if we've any scope to optimize the existing code.

    Thanks anyways,

    Abhi

    Friday, May 23, 2014 7:36 AM