locked
Stop multiple wait instances - workflow crm 2011 RRS feed

  • Question

  • hi

    I have contact entity filed  Visa expiry date. then i wrote workflow like following to generate mail to contact email  before expiry date. also  put it to run both on creation as well as change of visa expiry date filed. problem is when i change the date filed it will get separate wait instance of workflow causing  firing multiple mails  when date reach

    then i have go though some post and thanks to following post fixed the issue on multiple wait instances. but have a problem,  once reach success (mail sent)  workflow is going to cancel stage even if change date filed 

    https://community.dynamics.com/crm/b/crmpowerobjects/archive/2012/11/06/multiple-waiting-workflows-when-wait-conditions-and-timeouts-are-triggered-on-field-change.aspx#.UVHOrRyNnB8

    Please any one have idea how to rectify this. - Radika



    • Edited by Radika Tuesday, March 26, 2013 4:40 PM
    Tuesday, March 26, 2013 4:40 PM

All replies

  • One of your update steps is probably also triggering the same workflow and it is probably firing more than once as a result.

    Jamie Miley

    Check out RBA Today!

    Check out my about.me profile!
    http://mileyja.blogspot.com
    Linked-In Profile
    Follow Me on Twitter!

    Tuesday, March 26, 2013 5:51 PM
    Moderator
  • Hi,

    Actually, I don't think you need to register the workflow to run every time the expiry date changes. 

    If you had a workflow that runs On Create and As A Child workflow that:

    1. Waits until the Expiry Date is not null

    2. Waits until the Expiry Date has passed

    3. Sends email

    4. Sets the Expiry date to null again

    5. Runs the same workflow again.

    CRM will automatically change the workflow wait if the date changes, so it will always run at the correct time even if the date is different to when the workflow first ran.

    The Important thing is to not use '1 Day before/after' type clauses in your wait condition - since CRM can't then automatically track the date attribute in the wait condition - always set another date attribute and wait on that.


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"



    Tuesday, March 26, 2013 8:01 PM
    Answerer
  • Hi thanks

    My problem is after first cycle workflow succeed it won't get the cancellation + waiting ..cycle it goes to cancel state each changes to expiry date there after

    any idea rectify this 

    regards

    radika


    • Edited by Radika Wednesday, March 27, 2013 6:54 AM
    Wednesday, March 27, 2013 6:53 AM
  • Hi,

    Rather than cancel the workflow, you'll need to change the logic so that it run's it's self as a child workflow.


    Scott Durow
    Read my blog: www.develop1.net/public     Follow Me on Twitter
    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Wednesday, March 27, 2013 8:39 AM
    Answerer