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: The Value of property 'get' is null or undefined, not a function object

(0) ShareShare
ReportReport
Posted on by

Hello all,

I have some jscript code onload (CRM 2011 onpremise):

function get()
{
    var one = Xrm.Page.data.entity.attributes.get("new_orderamount").getValue();
    var two = Xrm.Page.data.entity.attributes.get("new_actualcost").getValue();
    var totalParse = 0;
    if ((two > 0 or two != null) and (one > 0)) {
    totalParse = (1-(two/one))*100;
    //alert(totalParse);   
  }
  
  Xrm.Page.getAttribute("new_new").setValue(totalParse);
  Xrm.Page.data.entity.attributes.get("new_new").setSubmitMode("always");
  
}

However when i open the form i always get this error (through F12 in IE):
Error: The Value of property 'get' is null or undefined, not a function object

Can anyone help?

Thanks in advance.

*This post is locked for comments

I have the same question (0)
  • jlattimer Profile Picture
    24,562 on at

    Try:

    Xrm.Page.getAttribute("fieldname").getValue()

    and

    Xrm.Page.getAttribute("fieldname").setValue("yourvalue")

    and

    Xrm.Page.getAttribute("fieldname").setSubmitMode("always");  

  • Community Member Profile Picture
    on at

    Hello jlattimer.

    Unfortunately still the same message...

    However i did noticed something... in this custom entity form i have 2 webresource with 6 functions (webresource1 has 5 functions and webresource2 has 1 function); so, i have 6 call to webresources but with different functions (all onload event); something like:
    webresource / function1
    webresource / function2
    webresource / function3
    webresource / function4
    webresource / function5
    webresource2 / get

    I just tried to create only 1 webresource with the 6 functions (still all of them onload):
    webresource / function1
    webresource / function2
    webresource / function3
    webresource / function4
    webresource / function5
    webresource / get

    Now i still have the same error message in jscript debug, but at this moment in a differente function (in function1).
    This makes me wonder if there is any kind of limit to the number of functions in a webresource - is there any?
    From my tests i would conclude that i can only have 5 onload or onsave functions...

    Thanks in advance.

     

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