locked
workflow nightmare: checking if a task has been overdue RRS feed

  • Question

  • Hi there,

    I am having a hard time playing with workflows in CRM.

    I must do what seems to me as a simple workflow, but I am not sure if I should use CHEKC STATUS or WAIT CONDITION, and I am not sure of some fields.

    Upon the creation of a lead, a phone call task is created to the Lead owner, which must be done in 24 hours:
    • IF the owner DOESN'T CALL the lead in 24 hours (marks the task as completed), then an email reminder is sent to owner and sales manager
      • After the first reminder, will wait for an addition 12 HOURS
        • IF call is not completed in 12 HOURS, then a second reminder is sent
          • Workflow now on WAIT condition until the call is closed
            • Lead Qualified: END
        • IF call is completed in 12 HOURS
          • Lead Qualified: END
    • IF the owner CALLS the lead in 24 hours
      • Lead Qualified: END

    Questions:
    1. After the Phone Call creation step, should I add a CHECK CONDITION or a WAIT CONDITION to check if the task is overdue
    2. How would I check if the task is overdue? In a perfect world, I would check if the "DUE" field of the phone call task against the CURRENT DATE AND TIME.
    Thank you for the help!

    Regards,
    P.


    Sunday, February 15, 2009 12:06 PM

Answers

  • You can add a parallel wait condition where if any one condition is met the others stop waiting. This is deeper than I've ever played with wait conditions but I'm thinking you could run a parallel wait condition looking for when the task is completed or cancelled. Off the top of my head I'm thinking you may also need a secondary workflow which populates a 'closed on' field which would show the datetime a task is cancelled/completed triggering off a status change and then use this field for the parallel wait.
    • Proposed as answer by Leon TribeMVP Sunday, February 15, 2009 9:47 PM
    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Sunday, February 15, 2009 9:47 PM
  • Workflows need to be triggered by something e.g. creation, field change, status change etc.  

    Given you're checking for inaction, your best bet is the creation of the task. Stick in a wait timeout condition for 1 day after task created on (or workflow execution time) then use an IF statement to check if the task status reason is still in progress and if so send the email.

    At this point put in another wait timeout for 1 day 12 hours after the created on and then do as above for the second email.

    If you want to check on the due field put in a wait condition and set the workflow timeout to equal the task due date.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog


    • Proposed as answer by Leon TribeMVP Sunday, February 15, 2009 1:25 PM
    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Sunday, February 15, 2009 1:24 PM
  • Rereading through I think you're right in simply checking at each step if the task is closed. The parallel wait won't work. My thinking was you could run the wait for close in parallel to the 24/12 hour waits.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/

    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Monday, February 16, 2009 12:13 PM

All replies

  • Workflows need to be triggered by something e.g. creation, field change, status change etc.  

    Given you're checking for inaction, your best bet is the creation of the task. Stick in a wait timeout condition for 1 day after task created on (or workflow execution time) then use an IF statement to check if the task status reason is still in progress and if so send the email.

    At this point put in another wait timeout for 1 day 12 hours after the created on and then do as above for the second email.

    If you want to check on the due field put in a wait condition and set the workflow timeout to equal the task due date.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog


    • Proposed as answer by Leon TribeMVP Sunday, February 15, 2009 1:25 PM
    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Sunday, February 15, 2009 1:24 PM
  • Hi there,

    Thank you for the tips. Here is what I have done:
    1. Create a phone call activity due in 24 hours after workflow execution (it is a child workflow, so it must be workflow execution and not lead creation)
    2. The very next step is a workflow wait timeout condition (followed these instructions) that would activate 1 minute after the phone call due date/time
      1. It then checks if the call is still open. Otherwise, it would trigger supposed overdue notifications for closed phonecall tasks (duh)
        1. then if phone call still open it will do a series of things.
        2. Then there is another wait timeout condition on this level for a second reminder
          1. It then checks once again if the call is still open
            1. Then do a series of things.

    My problem with this is that I would like to add a check that as soon as the call is completed or cancelled then the workflow should stop. I tried adding wait conditions for the call's status to be completed or cancelled, but if I add this at the bottom of the workflow it wouldn't work as the workflow would be processing the first wait timeout for the reminders... If I add this to the top then the wokflow owuld be forever waiting for the call status to be completed or cancelled, and would never triger the wait timeout condition for the reminders...

    Any thoughts?

    Regards,
    P.
    Sunday, February 15, 2009 3:33 PM
  • You can add a parallel wait condition where if any one condition is met the others stop waiting. This is deeper than I've ever played with wait conditions but I'm thinking you could run a parallel wait condition looking for when the task is completed or cancelled. Off the top of my head I'm thinking you may also need a secondary workflow which populates a 'closed on' field which would show the datetime a task is cancelled/completed triggering off a status change and then use this field for the parallel wait.
    • Proposed as answer by Leon TribeMVP Sunday, February 15, 2009 9:47 PM
    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Sunday, February 15, 2009 9:47 PM
  • Hi there,

    Perhaps a parallel wait condition is the way to go. But I don't understand your suggestion (from the top of your head) about a secondary workflow...

    Perhaps it would be better if I give a simpler example?

    If I add a workflow to trigger after an opportunity is created:
    1. User would follow a series of tasks that once completed, would be followed by another task
    2. BUT if the user closes the opportunity as CANCELED at any time during the workflow, the workflow SHOULD STOP
    1. I added a wait condition just at the top of the workflow to check IF the opportunity has been closed, to stop the workflow
    2. As a parallel process I added a wait condition to check IF the opportunity is open, to follow through a series of tasks (each to be created after the previous has been completed)
    Problem:
    As soon the opportunity is created, the wait condition would trigger that that opportunity is open and go through the steps of creating tasks, each after the previous has been completed. If at any stage the user closes the opportunity, the wait condition from the top that would never be triggered.

    The only solution I found for this is to add check statements before the creation of each step, that will stop the workfow if the opportunity is closed, or continue otherwise. I was hoping that there was a better way of doing this... Is this the only way?

    Thanks,
    P.
    Monday, February 16, 2009 11:58 AM
  • Rereading through I think you're right in simply checking at each step if the task is closed. The parallel wait won't work. My thinking was you could run the wait for close in parallel to the 24/12 hour waits.

    Leon Tribe
    Want to hear me talk about all things CRM? Check out my blog
    http://leontribe.blogspot.com/

    • Marked as answer by pmdci Monday, February 16, 2009 12:15 PM
    Monday, February 16, 2009 12:13 PM
  • Leon,

    Thank you for the feedback.

    Perhaps (big perhaps) if the workflows were designed in Visual Studio, there would be better event handling functions in there? I mean thinking very in very low-level programming concepts, this should be possible...
    Monday, February 16, 2009 12:16 PM