0

When I create an order from a contact I want the account of the contact on the regarding field and not the contact. Because of that I created a code in the onload event which works very well.

if (
(window.opener != null) && 
(window.opener.parent != null) && 
(window.opener.parent.document != null) && 
(window.opener.parent.document.crmForm != null)) {

    var parentForm = window.opener.parent.document.crmForm;
    if (parentForm.ObjectTypeName == "contact")
    {
        if (parentForm.parentcustomerid.DataValue != null)
        { 

            var newIdArray;
            newIdArray = parentForm.parentcustomerid.DataValue;
            crmForm.all.customerid.DataValue = newIdArray;
            //crmForm.all.from.DataValue = newIdArray;
        }
    }
}

The problem appears when I have created a quote and try to convert it to an order. The following warningerror appears. (I have done my best to translate it from Norwegian)

"It appeard an error with the customized event for this field.
Field: Window
Event: Onload
Error: The server (not the serverprogram) is not available and is gone. The connections is not guilty. The event has not been made."

After that you click ok and it works ok. Does anyone know why this warningmessage appear?

Thanks, Martin

1 Answer 1

0

Could you debug through your codes, and check whether your are referencing a property which is a null.

In example, in your code, you are retrieving : newIdArray = parentForm.parentcustomerid.DataValue, it could be that the parentForm.parentcustomerid is indeed null.

This is a reference that i found when i googled for the error message : http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/ed4052e7-02b5-4b6f-9e26-85dd7a77f7ef

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.