title: Microsoft Dynamics CRM 4 custom entity form onload event not firing
body: <p>We have a problem with the onload event of the form for a custom entity not firing.  The form did work correctly for a period but recently has stopped working.  Now none of the code in the event is executed when the form is opened - either when creating a new instance of the entity or when opening an existing one.  The code does however get executed when the form is previewed.  </p>
  
  <p>For testing purposes the original code has been removed and the onload event currently only has the following:</p>
  
  <pre><code>crmForm.all.ownerid_c.style.display = 'none';
  crmForm.all.ownerid_d.style.display = 'none';
  alert("OnLoad event fired");
  </code></pre>
  
  <p>In preview the Owner attribute is hidden and the alert is shown.  When running the form normally the attribute is not hidden and there is no alert (there are also no Java errors reported).</p>
  
  <p>The full CRM version is 4.0.7333.1219.  The entity was originally created on a different CRM installation which was initially version 3.  That environment was upgraded to version 4 before we did the export – import process for migrating it to the current environment.  The form worked correctly for a period of time on the new environment but at some stage stopped doing so.</p>