Hi
I want to populate a date on a field when a check box is ticked. In crm 3.0
I referred to a code from Michael Hohne's website(thanks to him as always)
pasted as below on the form on load event:
crmForm.all.new_field1.onclick = function() {
crmForm.all.new_field1.FireOnChange();
}
//declaring a global variable
_windowClosing = false;
//onbeforeunload is called when you close the form but before the OnChange
event is triggered
window.onbeforeunload = function() {
_windowClosing = true;
}
On the on change event on the form i have the following code:
if (!_windowClosing)
if (crmForm.all.field1.DataValue == true)
{
crmForm.all.field1date.DataValue = new Date ();
}
else {
crmForm.all.field1.DataValue != true
crmForm.all.field1date.DataValue = null;
}
However this does not seem to be working for 4.0. If i remove the form on
load code it works but the user has to click somewhere after clicking the
checkbox to see the date populating.
With this code in crm 3.0 user was able to see the date populating right away.
I would really appreciate some assistance in how to implement such a
functionality for crm 4.0
Look forward to some guidance.,,
Cheers
Snow White