Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

How to calculate the next business day

Posted on by Microsoft Employee

Does anyone know how I can do this for Dynamic CRM? Using Javascript perhaps and what the syntax should be?

*This post is locked for comments

  • Suggested answer
    Kumar Viju Profile Picture
    Kumar Viju 1,026 on at
    RE: How to calculate the next business day

    Hi,

    Check if this Workflow Utility can help your requirement. It has good date calculation features.

    [View:https://crmdatetimeworkflowutilities.codeplex.com/:750:50]

  • am462 Profile Picture
    am462 110 on at
    RE: How to calculate the next business day

    If I understood your question correctly, following JavaScript will return you the next business day date, assuming Monday to Friday are business days:

    var d = new Date();

    var nextBusinessDay;

    switch (d.getDay()) {

    case 5:

    nextBusinessDay = new Date(d.setDate(d.getDate() + 3));

    break;

    case 6:

    nextBusinessDay = new Date(d.setDate(d.getDate() + 2));

    break;

    default:

    nextBusinessDay = new Date(d.setDate(d.getDate() + 1));

    break;

    }

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to calculate the next business day

    Thanks but I think i need javascript or a workflow that would calcuate the next business date

  • Suggested answer
    Mahadeo Matre Profile Picture
    Mahadeo Matre 17,021 on at

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,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans