web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error with this field's customized event - closed opportunities only

(0) ShareShare
ReportReport
Posted on by 608

I am getting the attached error when I view a closed opportunity.  I tried to debug the error and found the attached.  Can anyone help me decipher why this happens on closed opportunities?

At first I thought it was related to a custom business process flow I am testing, but it also happens with old opportunities that were closed before the bpf was used.

Any help will be greatly appreciated.

5342.Capture.JPG

*This post is locked for comments

I have the same question (0)
  • ashlega Profile Picture
    34,477 on at

    Hi Barbara,

     are there any scripts attached to the opportunity form? They probably should not be doing whatever it is they are doing when the opportunity is closed/readonly

  • Barbara Forsman Profile Picture
    608 on at

    There are a few scripts attached.  Is there a way to disable them one by one so I can find the culprit?

  • ashlega Profile Picture
    34,477 on at

    Sure - just open the form in the designer, open form properties, make sure you are looing at the onload event handlers  double click on any of them - there will be "Enabled" checkbox (just where you are normally entering the function name)

    Don't forget to publish those changes..

    And, maybe, reopen the browser (or use a private session). Sometimes, the cache does not get cleared right away.

  • Barbara Forsman Profile Picture
    608 on at

    I actually don't have any Form OnLoad Events for the Opportunity form.

    0702.Capture.JPG

    Since the error I receive says the following, is there a different place to looks for window onload events? 

    "There was an error with this field's customized event. 

    Field:  window 

    Event:  onload

    Error: Unable to get property 'controls' of undefined or null reference"

    Many thanks for your help!

  • ashlega Profile Picture
    34,477 on at

    If it's coming from "your" scripts, then, at least, you should be able to see those scripts among the libraries. How did you get to the form designer? Could you confirm it's the same form in the form designer as the one showing the error? (Unless you opened form designer from the solution, 365 will bring up the top-most form when you click "form" button - that form can be different from what you had open on the screen)

  • Barbara Forsman Profile Picture
    608 on at

    Thank you!  I did confirm I was getting the error on my "NLK Opp Form 2017" and there are no OnLoad event handlers on the NLK Opp Form 2017.  

    6170.Capture.JPG

    I did look in my Web Resources and checked dependencies for all the scripts.  There is only one script that is unmanaged that had a dependency on the inactive "Information" form.  I removed the script, saved, published, opened a new InPrivate window to test, and I get the same error.    :(

  • Verified answer
    Waqar Sohail Profile Picture
    on at

    Dear Barbara,

    I believe some system field is removed from Form which is required by System Script, Can you please go to form customization and try to add missing fields.

    Or can you share list of un-used fields from Form Customization which are on right side?

    Here is the same thread which I face few year ago!

    community.dynamics.com/.../143569

  • Loic Orue Profile Picture
    927 on at

    I'm having the same issue since a couple of days as well. Have you managed to find a solution?

  • Barbara Forsman Profile Picture
    608 on at

    Thank you thank you thank you!  I re-added some system fields that had been removed from the form and that solved the issue!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans