locked
Error onload in CRM 2011 RRS feed

  • Question

  • Hi All

    Getting error as

    There was an error with the fields customized event.

    Field : Window

    Event :Onload

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

    Tuesday, September 29, 2015 10:35 AM

All replies

  • share the custom javascript code attached to the onload event

    My blog: www.crmanswers.net - CRM Theme Generator

    • Proposed as answer by P H S Wednesday, September 30, 2015 7:25 AM
    • Unproposed as answer by P H S Wednesday, September 30, 2015 7:25 AM
    Tuesday, September 29, 2015 10:53 AM
  •        

            Xrm.Page.getAttribute('XXX').controls.get(0).setDisabled(true);
            Xrm.Page.getAttribute('XXX').controls.get(0).setDisabled(true);
            Xrm.Page.getAttribute('XXX').controls.get(0).setDisabled(true);
            Xrm.Page.getAttribute('XXX').controls.get(0).setDisabled(true);
            Xrm.Page.getAttribute('XXX').controls.get(0).setDisabled(true);
            var date = new Date();
            Xrm.Page.getAttribute("XXX").setValue(date);
            Xrm.Page.getAttribute("XXX").setValue(YYY);
            Xrm.Page.getAttribute("XXX").setValue(YYY);
            Xrm.Page.ui.controls.get("XXX").setVisible(true);
            Xrm.Page.ui.controls.get("XXX").setVisible(true);

    Tuesday, September 29, 2015 11:30 AM
  • Based on your code I can assume that 'XXX' attribute is not present on the form that leads to error. I would suggest attentively recheck that attribute 'XXX' is really present on form.

    Dynamics CRM MVP
    My blog


    • Edited by Andrii ButenkoMVP, Moderator Tuesday, September 29, 2015 11:49 AM
    • Proposed as answer by P H S Wednesday, September 30, 2015 7:25 AM
    • Unproposed as answer by P H S Wednesday, September 30, 2015 7:25 AM
    Tuesday, September 29, 2015 11:49 AM
    Moderator
  • Hello,

    Please check if the attribute "XXX" is really present on the form or not. Match the spelling of attribute name (that is "XXX") to the correct one.


    • Edited by P H S Wednesday, September 30, 2015 7:26 AM
    • Proposed as answer by P H S Wednesday, September 30, 2015 7:26 AM
    Wednesday, September 30, 2015 7:24 AM
  • I have checked all the attribute names...all are correct and present on the form.
    Wednesday, September 30, 2015 10:00 AM