Hi,
Have been trying for a while to modify Form Properties unfortunately I am not able to modify too much of the code just what is in red below.
var vSerialNumberValue = Xrm.Page.getAttribute("jov_serialnumberid").getValue();
if (vSerialNumberValue == null || vSerialNumberValue == "undefined") {
return;
}
var vSerialNumberId = vSerialNumberValue[0].id;
var vSerialNumberEntity = SelectEntity("jov_productdb", "jov_productdbid", vSerialNumberId);
if (vSerialNumberEntity == null) {
return;
}
// get Date sold and put in date sold#
var rdl_datefieldstring= GetAttribute(vSerialNumberEntity, "jov_datesold")
if (rdl_datefieldstring!= null)
Xrm.Page.getAttribute("rdl_datefieldstring").setValue(rdl_datefieldstring);
Basically I am trying to pull a date from a date lookup field in one entity (jov_datesold which displays in mm/dd/yyyy format) then display it in a form in a different entity the new field called "rdl_datefieldstring" . If I set the target field rdl_datefieldstring to be a date lookup value the below script returns nothing. If I set the target field rdl_datefieldstring to be just a regular text field I get the date displayed but like this (2013-12-31T11:04:29-05:00) which I would then need converted to mm/dd/yyyy format.
I have spent alot of time trying find scripts that will parse the data in to the correct format using sdf but not sure if the system recognize that function. Is the right method here to find a way to parse the collected data or should the target field be a date lookup field and perhaps I missed a step to explain why script doesnt work.