I am trying to pull out a date from one field, modify that date and set that value into another, here is my code:
var startDate = Xrm.Page.getAttribute('new_startdate').getValue();
var expiryDate = startDate.getDate()+3; //Add 3 days
var expiryField = Xrm.Page.getAttribute('new_expirydate').setValue(expiryDate);
Can someone explain what I’m doing wrong? I’ve been at this for a while now and I fear I’m missing something blatently obvious..
Thanks in advance.
EDIT;
When the script fires, 1/1/1970 is set in the expiry field.
this should work