Skip to main content



No record found.

Microsoft Dynamics CRM forum
Suggested answer

JavaScript code for Formula field

Posted on by 33
Good Afternoon All,
I am new to Dynamics 365 CRM and I am trying to create a formula (Calculated) field that counts the number of days between two dates (created on date and today), not counting weekends.
I am not a developer and do not know how to write JavaScript. I have tried code generators but they did not help much.
Does someone have a JavaScript code that they can and would be willing to share with me?
Thank you
Shawn Low
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
  • Suggested answer
    Adrian Begovich Profile Picture
    Adrian Begovich 20,973 Super User on at
    JavaScript code for Formula field
    Hi Shawn,
    You can find JavaScript code that does this here.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans