Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Add working days to a date

Posted on by Microsoft Employee

I have a requirement to display the date which is 5 working days from the date I received an application. I have a field 'Received On', and 'Acknowledgment Due On'.

Working days are defined in legislation and do not include weekends, public holidays and the period between 25/12 and 2/1 each year.

I would like to achieve this without code if at all possible. Does anyone have any ideas? I have Googled for an answer but so far I have not come up with anything that I can repeat.

*This post is locked for comments

  • Verified answer
    Kokulan Profile Picture
    Kokulan 18,048 on at
    RE: Add working days to a date

    Hi

    Code option suggested by Andrew gives you more flexibility and control but if you cant go for that option, you can certainly achieve the same using SLAs.

    You can create an SLA with 5 working days and when you create the record, CRM will create SLA KPI instance for that record. You can have a workflow to copy the End Date from the KPI instances to a date-time field on the main entity - This will have you the actual date after 5 working days from Received On or Acknowledgment Due On.

    community.dynamics.com/.../adding-sla-39-s-to-other-entities

    If you want you can actually use the KPI instances to have a count down timer on the form as well

    Hope this helps

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Add working days to a date

    Laura,

    If you have issues using toolkit as it is you can get just the code of piece you need. It is here - github.com/.../AddBusinessDays.cs

    And I worked in bank in one project - I heard of hadeaches that security policies can bring.

  • Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: Add working days to a date

    if you can't use other people code than you need to write your own, considering also the fact that you need a custom rule for the public holidays and the period 25/12-2/1 you mentioned.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Add working days to a date

    Hi Ravi, thanks for this. I had already found this article but was reluctant to download other peoples code due to potential security issues...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Add working days to a date

    Hi Andrew, Thanks for the suggestion. Workflow is definitely an option however I'm not sure if we're allowed to use other people's code... working in a bank so we're very security conscious :) Will ask the security guys for permission!!

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Add working days to a date

    Hi,

    There is nothing available out of box for this. Also as your requirement is relatively complex I don't think you can achieve this without code however there are some workflow utility exists (as mentioned above) which you can try to achieve your requirement.

    Take a look at this article-

    community.dynamics.com/.../tip-1144-how-to-add-business-days

    Hope this helps.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Add working days to a date

    Hello Laura,

    If workflow is an option you can use my toolkit (UWT in my signature) that contains "Add Business Days" operation.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans