Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error OnSave Get Object CRM 2011

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I’m new to the forum and CRM so hoping you experts can help solve a minor irritation

 

Recently we’ve started to get an error message when we click on ‘Save’ or ‘Save & Close’ in Opportunity records.

 

“There was an error with this field's customised event.

 

Field:crmForm

 

Event:onsave

 

Error:Unable to get property 'getObject' of undefined or null reference”

 

We're not 100% what triggered this as we have done a few changes to the Opportunity form, moved, added and removed superfluous fields, so could be anyone of these.

 

The script in question is:

 

//call the saveMultiSelect function of the Multiselect html web resource on save of the form.

 

function multiSelectOnSave(executionObject) {

 

   Xrm.Page.getControl(executionObject).getObject().contentWindow.window.saveMultiSelect();

 

}

 

I’ve searched high and low to try and solve this question, looked in books and scoured the internet but without success, what I need to know is:

 

a)      Is it safe to just delete this event?

b)      If not can anyone help or point me in the right direction to correct it?

 

Any help would be greatly appreciated.

 

Many thanks

 

 

Nick

*This post is locked for comments

  • RE: Error OnSave Get Object CRM 2011

    I have removed it, the error message is no longer happening, I guess I'll just have to monitor to see if their any repercussions.

    Many thanks for your help.

    Regards

    N

  • RE: Error OnSave Get Object CRM 2011

    The one I removed was a 28 item check box list, but now when I put it back on the form it is a drop down menu, this field was removed though as it is no longer required. So if it is this causing the problem, can I not just delete the OnSave function?

    Many thanks

    N

  • RE: Error OnSave Get Object CRM 2011

    Hi Guido,

     

    There are no check boxes on the actual form, only two radio buttons for the revenue, one of the fields I removed was check boxes, but when I put the field back on to the sheet it's only a drop down menu now?? so I either have the wrong field or it has changed, I have also looked at all the properties of the fields like you suggested and none are called MultiSelect1, not sure whether this has any relevance, but in the event OnSave it says MultiSelect1 but everywhere else it just says MultiSelect? I can't upload the screenshot of the whole form as I can't get it down to 64kb I'm afraid.

     

    Regards

     

    N

  • RE: Error OnSave Get Object CRM 2011

    Hi Guido,

     

    Many thanks for your reply, please see below screenshot as per your post:

     

     

    I'm not sure what the 'MultiSelect1' refers to but I did put back the fields I removed, none of them where locked, and didn't seem critical, but the problem still persists.

     

    Many thanks for all your help.

     

    Kind regards

     

    N

  • RE: Error OnSave Get Object CRM 2011

    Hi Suresh,

    Many thanks for your reply, I tried that and it still gives the same error, I copied and pasted your code as above, tried both the following:

    6153.Code-02.png

    8420.Error-Message.png

     

    And I still get this message:

     

     

    Maybe I've entered them in wrongly so any help is greatly appreciated.

     

    Kind regards

     

     

     

    Nick

  • suresh p Profile Picture
    suresh p 1,320 on at
    RE: Error OnSave Get Object CRM 2011

    Hello, just replace this code in your web resource.

    function multiSelectOnSave(executionObject) {

     if(executionObject != null){

      Xrm.Page.getControl(executionObject).getObject().contentWindow.window.saveMultiSelect();

      }

    }

    then save and publish this web resource and check once again.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans