Dynamics CRM – Window OnLoad Unable to get property ‘value’ of undefined or null reference

We recently had a problem where we were receiving the following error in a single environment only.


Due to it only occurring in one environment I presumed it was a deployment issue. However I was incorrect.

We were receiving the above error because we restored a full database from one environment to another. We had some JavaScript which was checking the owner of a record. The owner was displayed on the record however it was from an external domain.

Because of this it threw an error right down in the CRM depths at:-

function crmForm_window_onload_handler(eventObj,eventArgs){


    var eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,null,null);





  } catch(e) {

    displayError('window', 'onload', e.description);


So if you see an error occurring like this that did not appear in other environments make sure you confirm that the record you are looking at is correctly mapped to the new domain.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s