Tech Support > Microsoft Windows > Windows CRM > Checkbox Jscript CRM 4.0
Checkbox Jscript CRM 4.0
Posted by Snow White on July 3rd, 2008


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

Posted by Michael Höhne on July 4th, 2008


See http://www.stunnware.com/crm2/topic.aspx?id=JS30. It shows/hides tabs as
a result of changing a checkbox, radio button or picklist value. The
checkbox is what you need.

--
Michael Höhne, Microsoft Dynamics CRM MVP
CRM Blog on http://www.stunnware.com

----------------------------------------------------------


"Snow White" <SnowWhite@discussions.microsoft.com> schrieb im Newsbeitrag
news:701AA59E-2E55-4B4A-B2A9-8CC5F2B629F7@microsoft.com...



Similar Posts