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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

capture date time when onchange event triggered

(0) ShareShare
ReportReport
Posted on by 340

Hi Experts, 

I want to capture the date time when onchange event triggered ?

So that i can calculate time duration between that field change till case resolved.

Thanks in advance 

Regards, Alok 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Alok,

    You can do this using Calculated field , check below reference -

    https://community.dynamics.com/crm/b/meganwalker/archive/2017/08/17/difference-between-two-dates-with-calculated-fields

    Also here is some JS operation you could also see -

            var dateTimeValue = Xrm.Page.getAttribute("datetimeFieldName").getValue();
            var crmDateValue = new Date(dateTimeValue);
            var year = crmDateValue.getFullYear();
            var month =crmDateValue.getMonth() + 1;
            var day = crmDateValue.getDate();
            var hour= crmDateValue.getHours();	//Get the hour (0-23)
            var min = crmDateValue.getMinutes();//	Get the minute (0-59)
            var sec = crmDateValue.getSeconds();//	Get the second (0-59)


  • Suggested answer
    Radu Chiribelea Profile Picture
    6,667 on at

    Hi Alok,

    I think you can create a new DateTime field and when the on change event handler is called, within the event handler populate also the DateTime field created earlier.

    I think you can use following method: www.w3schools.com/.../jsref_tolocalestring.asp

    Hope this helps

    Radu

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans