R – Add onchange event to a “locked” field in Dynamics CRM 4

crmdynamics-crmdynamics-crm-4

I'm customising Dynamics CRM 4 and would like to modify the Form for the Case entity to add some JavaScript to the onchange event for the Knowledge Base Article lookup field (kbarticleid_ledit). However, when I click Change Properties for that field I get an error message:

This field belongs to a locked section and cannot have its properties modified.

How can I get around this and edit it? Is there a workaround similar to customizing the Article view? Or can I hack the DB somehow to "unlock" that field?

Best Answer

You could also have added onchange code from the onload event. For example, if the locked field's id was lockedField, you could do something like this.

var field = crmForm.all.lockedField;
if (field)
    field.attachEvent('onchange', onChangeEventHandler);

function onChangeEventHandler()
{
    // do something 
}
Related Topic