Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Set End Date from Start Date in addition of months from a field using js

Posted on by 55

Hi,

I have requirement where I need to set End Date from adding number of terms (which is in months) and Start Date.

Please find the image below... as we can see the term is 6, and start date is 1/1/2021.. so I want to add 6 month to start date (i.e. 1/7/2021) and set this into the field Lease End Date

pastedimage1635153208753v1.png

Regards, 

Shoaib Khan

  • ShoaibKhan Profile Picture
    ShoaibKhan 55 on at
    RE: Set End Date from Start Date in addition of months from a field using js

    Thanks Leah Ju,

    It was very helpful....

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Set End Date from Start Date in addition of months from a field using js

    Hi ShoaibKhan,

    You can refer following link:

    Adding Days/Months/Years to Date field in CRM using JavaScript – Murali Sabbavarapu CRM Blog (wordpress.com)

    Note:

    the Xrm.Page has been deprecated, you need use following syntax to replace:

    formContext.getAttribute(arg).getValue()

    formContext.getAttribute(arg).setValue(value)

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,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans