In my form I have a date field that gets the current date in yyyy/mm/dd format and a field that auto-generates a number.
I want to populate another field in the following format:
yyyy-mm-dd-autogenreatenumber
.
Where the year and month and date are the current dates of the form.
Currently I have this code:
function number()
{
var dateFieldValue = Xrm.Page.getAttribute("date field name").getValue();
var autonumberFieldValue = Xrm.Page.getAttribute("autonum field name").getValue();
var result = dateFieldValue+ "-"+ autonumberFieldValue;
Xrm.Page.getAttribute("the other field name").setValue(result);
}
What I get is the complete date format like Friday July 26th 2013-autonum, whereas I want something like this 2013-07-26-autonum.