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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Add duration to time field

(0) ShareShare
ReportReport
Posted on by

Hi All,

How do i go about adding a duration field to a time field.

For example one selects duration of 45 mins and time is 10:00 .. I want records this as 10:45.

Thanks,

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Ben Thompson Profile Picture
    6,350 on at

    A duration field is a whole number field that contains in the background a value in minutes.

    To get the end date / time you can use either a workflow, flow or plugin to addminutes(duration) to the starting date field.

  • Suggested answer
    Ben Thompson Profile Picture
    6,350 on at

    duplicate

  • Jay2014 Profile Picture
    on at

    you cant add a duration to a time field using a workflow. The duration field is locked is locked down.

    Any references to help me with Java Script / Plugin ?

  • Suggested answer
    Sreevalli Profile Picture
    3,264 on at

    Hi,

    go through the similar scenario community.dynamics.com/.../221343

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    you can refer below post on how to update a duration field using JS. But , if you are using CRM 9.0 above, remember using the execution context.

    community.dynamics.com/.../802826

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Try this-

    ===================

    function setProgramEnd() {

       var ProgramStartDate = Xrm.Page.getAttribute("new_programstartdate").getValue();

       var ProgramDurationInMinutes = Xrm.Page.getAttribute("new_programduration").getValue();

       var ProgramEndDate = new Date(ProgramStartDate.getTime() + ProgramDurationInMinutes * 6e4);

       Xrm.Page.getAttribute("new_programenddate").setValue(ProgramEndDate);

    }

    ==================

    Hope this helps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans