none
Is there any way in Microsoft dynamics CRM 2011 by which we can schedule some code to run at certain frequency?

    Question

  • Hello,

    We wrote some code for TAT logic calculation for Customer Service Module in Dynamics CRM 2011 . As per requirement this code should be schedule to run in every 10 min.

    In my knowledge MS dynamics CRM don't have out of box scheduling engine. In that case who we can manage this requirement ?

    Is there any way in Microsoft dynamics CRM 2011 by which we can schedule some code to run at certain frequency?

    Has anybody face such requirement?

    Any idea will be highly appreciated.

     


    Saturday, November 02, 2013 8:57 PM

Answers

  • Hi Bruno,

    We decide to go for Window Scheduler or create a window service to accomplish this task.

    Thanks

    • Marked as answer by husain Sartaj Tuesday, November 05, 2013 8:39 AM
    Tuesday, November 05, 2013 8:39 AM

All replies

  • You can create a workflow that calls itself recursively - here is an example: Scheduling recurring workflows in CRM

    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Saturday, November 02, 2013 9:20 PM
    Moderator
  • if you need guarantee to have a task running always on the same time\frequency its better to write a console application and set it to run under windows task manager or use SSIS integrated with CRM dynamics. that you can schedule a task under SSIS.

    For console application:

    http://msdn.microsoft.com/en-us/library/gg695803.aspx

    ssis:

    http://a33ik.blogspot.co.nz/2012/02/integrating-crm-2011-using-sql.html

    Regards,

    Bruno

    http://dynamicday.wordpress.com/


    I Hope I could help. If I have answered please mark as 'Answer'. If was just helpful, please vote. Thanks and happy coding!

    Sunday, November 03, 2013 2:48 AM
  • Hi Jason,

    There are two things which we should consider Using workflow recursively.

    1-As Workflows are executed asynchronously, they might not run immediately and depending on the server overhead they might take some
    seconds or minutes to complete (or even start!).

    2-If a workflow calls itself (on the same entity) more than 7 times in an hour, the 8th instance will fail. This failure was added to prevent a workflow from creating an infinite loop.

    So by using workflow we can not guarantee that our code will  run at fixed time say every 5 min. Depending on the sever overload the execution as well as start may be delay and also we can not schedule a workflow to run more than 7 time in a hour.

    If you have any other way around ,let me know.

    Thanks for your response  :)

     

    Monday, November 04, 2013 5:11 AM
  • Hi Bruno,

    I will check this and let you know.

    Thanks for your response

    Monday, November 04, 2013 5:45 AM
  • Hi Bruno,

    We decide to go for Window Scheduler or create a window service to accomplish this task.

    Thanks

    • Marked as answer by husain Sartaj Tuesday, November 05, 2013 8:39 AM
    Tuesday, November 05, 2013 8:39 AM
  • Cool. I found this other day

    http://workflowautomation.codeplex.com/

    sounds interesting if you already have the code inside of a workflow.

    I never used. I know Console apps with Task scheduler and SSIS have worked well for me.

    Cheers


    I Hope I could help. If I have answered please mark as 'Answer'. If was just helpful, please vote. Thanks and happy coding! Bruno Lucas, http://dynamicday.wordpress.com/

    Tuesday, November 05, 2013 9:00 AM