In CRM 2011, I want to be able to force a save of a form. My requirement is as below. 

1. When the user opens the form, I check if a particular field is empty or not.
2. If it is empty, I want to force a save, thereby triggering a plugin which will set the field.

My current code is as below. This is in the FormOnLoad function which is associated with LoadForm. 

```
if(checkfield == null){
  Namespace.Functions.Contact.FormOnSave();
}
else{
 // do nothing. 
}

```

Now, this fails with the following line

> 
> Can't execute code from a freed script.
> 
> 
> 

I have no clue as to how to proceed further. As a temporary fix, what I have done is the following

```
if(checkfield == null){
  setTimeout('Namespace.Functions.Contact.FormOnSave()',4000);
}
else{
 // do nothing. 
}

```

Any advice on why this is happening and how can I fix it without the timeout would be really helpful?

I have had a look at [this question](https://stackoverflow.com/questions/5812180/cant-execute-code-from-a-freed-script-ie6-ie7-ie8-ie9) and [this](https://stackoverflow.com/questions/83132/what-causes-the-error-cant-execute-code-from-a-freed-script), but in my case the form does get loaded or has it actually not yet loaded?

Either way, how can I force a save of a CRM form?