locked
Timeout fails if date field on which timeout works is left blank RRS feed

  • Question

  • Hi All,

    I have a workflow created in CRM 2013. It uses Timeout condition to wait for a date stored in a field on Opportunity record, and when the date is reached it creates a Task in the system. The problem is this field will be blank when opportunity record is created and could also be set as blank by the user later during the opportunity cycle, and due to this the workflow throws an exception.

    'An error has occured. Try this action again. If the problem continue check the Microsoft Dynamics CRM community ...blah ... blah...

    Now the technical error is...

    PostponeUntil parameter of WorkflowOperationPausedResult must be less than or equal to CrmDateTime.MaxValue.

    The Postpone date is set to 12/31/9999 12:59 AM just for your information.

    Is there anyway i can make this workflow work even if the date field is set blank. Looks like a bug to me which Microsoft should take it up in future release.

    Regards,

    Yogesh

    Tuesday, March 18, 2014 5:47 PM

Answers

  • Take a look at this blog post, particularly #4 and #6.

    https://paulnieuwelaar.wordpress.com/2012/12/06/workflow-wait-conditions-best-practices-dynamics-crm-2011/

    The second part of #4 describes using a hidden date field which your workflow populates with your actual date, then your workflow can trigger on change of your actual field, and uses a parallel wait to cancel the previous instance of the workflow if the 2 date fields are different (meaning another instance of the workflow has triggered).

    Using this approach you could add an additional check at the top of your workflow to make sure the date contains data.

    The result would be that a single workflow instance is fired initially, and is cancelled if no date is entered. When a date is entered, the workflow will trigger again. If the date is cleared, the workflow will be cancelled.

    Hope that helps

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism


    • Edited by Paul Nieuwelaar Wednesday, March 19, 2014 7:31 PM
    • Marked as answer by yogeshfd Friday, March 21, 2014 10:46 AM
    Wednesday, March 19, 2014 7:27 PM

All replies

  • You could have 2 wait conditions, one to wait until the field contains data, and then other to wait until the date is reached.

    However this may not work if the field value is cleared after being set initially.

    Hope that helps

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism

    Tuesday, March 18, 2014 7:38 PM
  • Thanks Paul,

    But thats what my issue is. Timeout wont work if the field value is cleared after initially setting it.

    Regards,

    Yogesh

    Wednesday, March 19, 2014 10:59 AM
  • make the field required or you should use contains data check.

    You could use a another date time field which store the data initially .

    and use the filed in your workflow and make this another field as hidden on load of form via javascript or Bussiness Rule in crm 2013.


    Hope this helps. ----------------------------------------------------------------------- Santosh Bhagat If this post answers your question, please click "Mark As Answer" on the post and "Vote as Helpful"

    Wednesday, March 19, 2014 11:12 AM
  • Take a look at this blog post, particularly #4 and #6.

    https://paulnieuwelaar.wordpress.com/2012/12/06/workflow-wait-conditions-best-practices-dynamics-crm-2011/

    The second part of #4 describes using a hidden date field which your workflow populates with your actual date, then your workflow can trigger on change of your actual field, and uses a parallel wait to cancel the previous instance of the workflow if the 2 date fields are different (meaning another instance of the workflow has triggered).

    Using this approach you could add an additional check at the top of your workflow to make sure the date contains data.

    The result would be that a single workflow instance is fired initially, and is cancelled if no date is entered. When a date is entered, the workflow will trigger again. If the date is cleared, the workflow will be cancelled.

    Hope that helps

    Paul


    If my response helped you find your answer please show your thanks by taking the time to "Mark As Answer" and "Vote As Helpful".

    Twitter LinkedIn Facebook Blog Magnetism


    • Edited by Paul Nieuwelaar Wednesday, March 19, 2014 7:31 PM
    • Marked as answer by yogeshfd Friday, March 21, 2014 10:46 AM
    Wednesday, March 19, 2014 7:27 PM
  • Thanks Paul. Perfect solution in there!
    Friday, March 21, 2014 10:46 AM