Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Cancel Existing Recursive Workflows with new Instance of Same Workflow

  • 1.  Cancel Existing Recursive Workflows with new Instance of Same Workflow

    SILVER CONTRIBUTOR
    Posted 11 days ago
    Hello All,

    Ok, so I find myself in a situation where I will need to create an Opportunity record from a recursive workflow that is fired off when a new Project (custom entity) record is created and set to create a new Opp 7 days prior to the Bid Date that is set on the Project record.  Now, that part is easy enough, but then the manager of the dept tells me there are a good bit of times where the Bid Date may very well change during the process, either to a later or earlier date.  Which puts me in a position where I would need to fire off the same workflow to create an Opp, BUT also kill off the waiting workflow that was fired on record creation.

    I have found this article on how to create a plug-in to accomplish this, however I am NOT a developer or have access to the tools needed to get this done (see link below).  Does anyone out there know of a ready to import solution that would allow for this?

    Workflow assembly to cancel waiting workflows

    Thank You,

    Lance

    ------------------------------
    Lance Day
    Systems Analyst, CRM
    Dunbar Armored
    Carlisle PA
    ------------------------------


  • 2.  RE: Cancel Existing Recursive Workflows with new Instance of Same Workflow

    SILVER CONTRIBUTOR
    Posted 10 days ago
    ​Hi Lance,

    You could split the workflow up in 2.
    1) set a timeout for 7 days that checks a box.
    2) workflow that triggers when the box is checked.

    in this way the user can check the box when ever they need it.

    You could also use a date/time field that is filled out on create and then have a wait until trigger on the field that fires the workflow. then the user can change the date. Maybe use both of the fields so the user have full control.

    ------------------------------
    Lars Petersen
    CRM Manager - Jyske Finans
    Jyske Bank Group
    ------------------------------



  • 3.  RE: Cancel Existing Recursive Workflows with new Instance of Same Workflow

    SILVER CONTRIBUTOR
    Posted 10 days ago
    Thank you Lars, but the solution @Mike Springer suggested works very well for this. I was not aware that OOB workflows would continue to monitor a date field when they are in waiting status.  The only change I had to make was to only fire the workflow on creation of the project, and remove the field change trigger on bid date.​

    ------------------------------
    Lance Day
    Systems Analyst, CRM
    Dunbar Armored
    Carlisle PA
    ------------------------------



  • 4.  RE: Cancel Existing Recursive Workflows with new Instance of Same Workflow

    GOLD CONTRIBUTOR
    Posted 10 days ago

    Lance,
    In cases where we are firing off some type of action that we don't want to duplicate later, we set a bit field on the appropriate record and check that as the process begins-- and exit if it's true (i.e opportunity already created).

    If you use a timeout until the bid date, then if the date changes prior to the original date input, the process should adjust to it if the date field is a process trigger.

    If the user wants to change the bid date after the original date and the opportunity is already generated, then I would train them to update the date on the created opportunity to the new bid date.

    Mike



    ------------------------------
    Mike Springer
    Dynamics 365 Senior Consultant
    PSC Group, LLC
    Overland Park KS
    ------------------------------



  • 5.  RE: Cancel Existing Recursive Workflows with new Instance of Same Workflow

    SILVER CONTRIBUTOR
    Posted 10 days ago
    Edited by Lance Day 10 days ago

    Hi Mike,

     

    Thank you for this, I tested this theory out and it works like a champ!!  If the Opp has already been created, this shouldn't be an issue since I am closing out the Project once an Opp is created.

     

    Thank Again!!

     

    Lance Day

    Systems Analyst, CRM
    Carlisle Construction Materials, LLC

    image001.png@01D4BFD0.0CE0F840
    1555 Ritner Highway
    Carlisle, PA 17013
    P: 717-706-6808

    E: lance.day@CarlisleCCM.com

     






  • 6.  RE: Cancel Existing Recursive Workflows with new Instance of Same Workflow

    D365UG/CRMUG ALL STAR
    Posted 9 days ago
    Glad things seem to be working now. You have a few options for this type of workflow. I recently wrote  a blog series looking at a case where you wanted to send an email if a Case wasn't modified in a certain amount of time. This is similar because of the need to watch the date as well as a set time frame. I also talk a bit about things to keep in mind when working with waiting workflows. I hope this helps. Have a great day!

    https://kyliekiser.com/category/case-study/alert-for-old-cases/​

    ------------------------------
    Kylie Kiser
    Product Owner, CRM
    Ascensus

    www.CRMUG.com/Washington
    KylieKiser.com
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role