locked
Recurring workflow problems RRS feed

  • Question

  • Hi all,

    I have a situation with a deployment to a charity.

    There is a custom entity called 'Donations' - this contains all of the info when somebody donates to the charity. The charity has people who pay a set amount on a recurring monthly direct debit, direct to the charity. Rather than create these manually within Dynamics every month, I need to write a workflow to automate this.

    I have added a radio button on the Donation form called 'Recurring' - below is a simplified version the workflow (WORKFLOW1)

    1. If recurring = YES
    2. then Timeout for one month
    3. After 1 month, create record (properties all set to copy values from initial donation).
    4. Stop Workflow

    Workflow is set to trigger on Record Create.

    I manually create the first record (DONATION1), specifying it's a recurring Donation. WORKFLOW1 triggers on create, checks the recurring field, waits a month and creates a duplicate donation (DONATION2). So far so good.

    The problem I have is this: The workflow DOES NOT trigger again on creation of DONATION2, which I need it to in order to continue to create duplicate donations at monthly intervals.

    Any ideas how to work around this?

    Thursday, October 31, 2013 11:38 AM

All replies

  • Hi,

    Have you checked the ownership of your workflow? Your WF might not be triggering again because of its ownership. Try making it at organization level if it helps triggering it.

    But even if you succeed in triggering it again, as you are trying to achieve infinite loop triggered using same old workflow, after few iterations (normally it 7) next triggered workflow may fail with similar error in description. 

    If you want to achieve infinite loop, single trigger action might not help. But miltiple triggering actions can solve your purpose. 

    Try below approach:-
    1. Create a dummy entity (not visible to users) and create one dummy record.
    2. Have this dummy entity related to your "Donations" entity
    3. Register your current workflow on delete operation of this dummy entity instead of Donation entity. (This is imp as we need to trigger each iteration separately & automatically instead of having it triggered once & following the loop.)
    4. Add one more step in your workflow (as a last step) to create a temp record of this Dummy Entity. 
    5. Create a bulk delete job on this dummy entity with your required schedule e.g. monthly

    So that whenever your bulk delete job runs, a record of "Dummy Entity" will be deleted which will triger your WF to create donation as well as dummy entity record and exit current iteration. Next time when bulk delete job will run, that will be a separate first iteration (as it is triggered through new iteration of bulk delete job & not older running workflow) and not the second iteration. 

    Hope this helps !!

    Regards,
    Rugved Gokhale
    Thursday, October 31, 2013 12:40 PM