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)

Form OnLoad Java Script error 'Unable to get property ' get label' of undefined or null reference'

(0) ShareShare
ReportReport
Posted on by 55

Hi, we have been recently updated to dynamics online CRM 2013 Fall and below js form onload property

function DisableSectionAttributes() {      function setFldDisabled(ctrl) {          ctrl.setDisabled(true);      }      function setFldEnabled(ctrl) {          ctrl.setDisabled(false);      }      var toggleSectionFlds = Xrm.Page.getAttribute('new_billable').getValue();      var ctrlName = Xrm.Page.ui.controls.get();      for (var i in ctrlName) {          var ctrl = ctrlName[i];          var ctrlSection = ctrl.getParent().getLabel();          if (toggleSectionFlds == false) {              if (ctrlSection == "Billing") {                  setFldDisabled(ctrl);              }          }          else {              if (ctrlSection == "Billing") {                  setFldEnabled(ctrl);              }          }      }  }

The above js is throwing following error:

'Unable to get property ' get label' of undefined or null reference'.

I have verified the names and labels of all the windows on the screen. The above js was working absolutely fine for last 10 months on previous version. 

Look forward to your help.

Regards

 

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Hosk Profile Picture
    on at

    I would suggest you press F12, start debugging and put in a break point on your javascript.

    then load the form again

    This will allow you step through the javascript line by line and find the problem variable.

  • Community Member Profile Picture
    on at

    Hello,

    As you specified that the same js was working fine in previous version and is not working in CRM 2013.

    Please run the Custom Code Validation tool for CRM 2013 from this link : www.microsoft.com/.../details.aspx and check if we have any unsupported code listed due to which we are having this issue.

    Thank You

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