web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Due date/time calculation in workflow

(1) ShareShare
ReportReport
Posted on by 301,025 Super User 2025 Season 2

Hi all,

Within a certain workflow we are looking for a way to fulfill escalation at certain fixed due dates. Suppose every Monday at 16:00 a certain task should be due. This is related to the process of the customer where there are some deadlines defined in the process where workflow is also used. This is currently not possible as you can only specify hours or days in addition to the start time of submitting the workflow.

The date/time due is also depending on the contents of the document. Take for example a timesheet. If the timesheet is submitted with a period in future (worker writes future absence hours) also the due date is probably a week later than the first coming Monday. If a timesheet is submitted too late (e.g. after 16:00 at Monday for the past week, the due date needs to be the current date/time)

As mentioned this is not possible by default. Has anyone had this similar requirement or has a solution (direction) available? Possibly we need to create a customization so only an answer you can customize it is not the answer I'm looking for. I wonder if anyone can share his experience or also support me in just telling that you have the same requirement.

*This post is locked for comments

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    I tried to play with available days to have e.g. only the Monday as working day. This is also not giving the correct results.

    In the Time limit settings of the workflow you can specify a Duration. If possible we would like to add an option here. Does anyone know if this part is customizable? In the meantime we will investigate further.

    Another option could be creating additional tasks which loops through the pending workflows and set the due date/time afterwards.

    If anyone like to respond on this thread, you are welcome to share your thoughts.

  • Verified answer
    Sohaib Cheema Profile Picture
    49,438 User Group Leader on at

    Have to thought to do it as following:

    1. Created a new setup table/form, where I do define that when a workflowTypw will be due (every Monday at 16:00)
    2. Create a new Batch/class which will run and make the task/workflow due as per specifies time in setup(#1). This batch job will make the task/workflow due, by code

  • Jonathan  Halland Profile Picture
    11,310 on at

    Hi Andre.

    Have you looked at creating a custom DueDateProvider in workflow?

  • Verified answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Although I haven't done it myself, you can use the "WorkflowWorkCalendarDueDateProvider" as an example. Basically in the resolve methods you can get the original record out of the "WorkflowContext" object and resolve it to a fixed date in anyway you choose.

    Basic steps

    1. Create class extending WorkflowDueDateProvider

    2. Create getCalendarTokens method and return a key value for each resolution type you would like. Probably only 1. e.g. Monday 16:00

    3. Create resolve and resolveNonUser methods that retrieve the original document via _context.parmTableId() and _context.parmRecId() and returns a date of your choosing.

    I hope this helps a bit. I'd be happy to create a more extensive blog post or something if needed.

  • André Arnaud de Calavon Profile Picture
    301,025 Super User 2025 Season 2 on at

    Hi Sohaib, Jonathan,

    Thanks for your answers. Both suggestions were on my list. Creating the table with setup and a batch is a solution which for sure will work, but not the preferred one.

    So we were about looking into the details of the due date providers. I think the directions from Jonathan are very helpful. Tomorrow we are going to have some detailed look into these classes and will try to find out if we can achieve the requirement.

    An extensive blog is still welcome :)

  • Suggested answer
    Jonathan  Halland Profile Picture
    11,310 on at

    Hi Andre.

    You can checkout the post over here: www.exploreax.com/.../creating-a-custom-workflow-due-date-provider

    Please let me know if you see errors or have suggestions on how to improve it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans