crm40 Reset required fields by javascript before deactivating an entity record
<p>The problem:
If an entity record - for example "account" - should be deactivate by the user, the required field message pops up saying that you first have to fill the field 'xy' ".</p>

<p>This is of course not necessary because of deactivation.</p>

<p>I tried to do the following but I did not succeed (javascript):</p>

<pre><code>function DeactivateAccount() {

   if (event.Mode == DEACTIVATE) {

       crmForm.SetFieldReqLevel("ad_myfield", 0);  // Reset required field
   }
}
</code></pre>

<p>This function is called in the "onSave" event of the form.
But the required-field-check occurs before my function ist called!
Any hint how to succeed?</p>
