Update Field based on a different field

This question is not answered

Good Morning,

I am trying to set up a JScript function that when triggered can populate another field.

I have a field called new_callstartdate which will contain the Start Date of a call and I want to automatically populate the field new_callenddate with a DateTime that is 10 minutes later.

Here is the code I am working with:

function myFunction()
{
var d2 = new Date(Xrm.Page.getAttribute("new_callstartdate").getValue());
d2.setMinutes (Xrm.Page.getAttribute("new_callstartdate").getMinutes() + 10);
Xrm.Page.getAttribute("new_callenddate").setValue (d2);
}

I have managed to get it to populate the same time using

Xrm.Page.getAttribute("new_callenddate").setValue (Xrm.Page.getAttribute("new_callstartdate").getValue());

But can't work out how to add the ten minutes.

Any help would be massively appreciated.

All Replies
  • Hi, Not sure if you can help me with this or if I should be asking somewhere else?

    Really need to find a solution to this issue.

    Thanks

    Adam

  • Still hoping that someone can help on this as I am drawing blanks

    Thanks

    Adam

  • Use the datejs library with your date manipulation scripts. It makes things so much more easy.

    Xrm.Page.getAttribute("yourAttribute").setValue(Date.today().addMinutes(10));

    See the documentation for the library at

    code.google.com/.../datejs