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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Utility.openEntityForm : Anonymousr:Unabletogetproperty'get_element'ofundefinedornullreference error

(0) ShareShare
ReportReport
Posted on by

Im getting error attached below while using the   Xrm.Utility.openEntityForm("customactivityform", null, parameters); to open a custom activity form. The custom activity form is getting some parameters from the contact form. all the parameters are passing fine. I have created code like below. The code works fine but before the form load of the custom activity i get the following error dialog. If i cancel the error, all parameters are passed to custom activity correctly. How do i get rid of this error as i can only trace it to the crm common/JsProvider.ashx. see code below

//On contact form load function
function OpenNewActivity() {
    var parameters = {};
    
    parameters["parentcustomerid_"] = Xrm.Page.data.entity.getId();
    parameters["parentcustomeridname_"] = Xrm.Page.data.entity.getPrimaryAttributeValue()
    parameters["parentcustomeridtype_"] = Xrm.Page.data.entity.getEntityName();
       parameters["fullname_"] = Xrm.Page.data.entity.attributes.get("fullname").getValue();
       Xrm.Utility.openEntityForm("customactivityname", null, parameters);
}


// on customactivityname form load function
function CustomActivityFormLoad(){
if (Xrm.Page.context.getQueryStringParameters().parentcustomerid_ != null && Xrm.Page.context.getQueryStringParameters().parentcustomerid_ != 'undefined') {

    var recorid = Xrm.Page.context.getQueryStringParameters().parentcustomerid_;

    var recordname = Xrm.Page.context.getQueryStringParameters().parentcustomeridname_;

    var entityname = Xrm.Page.context.getQueryStringParameters().parentcustomeridtype_;

    Xrm.Page.getAttribute("mycontactfield").setValue([{ id: recorid, name: recordname, entityType: entityname }]);
    Xrm.Page.getAttribute("fullname_").setValue(Xrm.Page.context.getQueryStringParameters().fullname_);

}

}

Full error details  

Microsoft Dynamics CRM Error Report Contents

<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Unable to get property 'get_element' of undefined or null reference</Message>
   <Line>1158</Line>
   <URL>/_common/JsProvider.ashx?ids=1759665639-1968334880-202661451-1194605645-1039841082-1793205875-1314140682-1547461133-1992083491-1000289424-159335543-1376927455-1030632819-1181113682-1380222012-513446117-1625018438-1460109179-1088147315-706656670-232397045-468302605-1405388298-1731109441-2029667886-202888856-342519603-542820515-1946640899-1603536461-1220618931-511599809-1264077421-1188909594-783705869-374257838-1463979649-1391165063-1359517414-1781702827-2050812538-512064351&ver=-795932359</URL>
   <PageURL>/_forms/read/page.aspx?dpLoaded_1=true&etc=2&id=%7baa30aa9f-2c76-e411-93f6-0003ff437dbf%7d&pagemode=iframe&postcode_4=true&theme=Outlook15White</PageURL>
   <Function>anonymousr:Unabletogetproperty'get_element'ofundefinedornullreference</Function>
   <CallStack>
    <Function>anonymousr:Unabletogetproperty'get_element'ofundefinedornullreference</Function>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; McAfee; MALNJS)</BrowserUserAgent>
   <BrowserLanguage>en-US</BrowserLanguage>
   <SystemLanguage>en-GB</SystemLanguage>
   <UserLanguage>en-GB</UserLanguage>
   <ScreenResolution>1242x698</ScreenResolution>
   <ClientName>Web</ClientName>
   <ClientTime>2014-12-09T21:47:19</ClientTime>
  </ClientInformation>
  <ServerInformation>
    <OrgLanguage>1033</OrgLanguage>
    <OrgCulture>2057</OrgCulture>
    <UserLanguage>1033</UserLanguage>
    <UserCulture>2057</UserCulture>
    <OrgID>{A051A28B-475C-4377-827B-4AC5E0F84687}</OrgID>
    <UserID>{B7C0982B-673E-E411-8100-D89D67632EAC}</UserID>
    <CRMVersion>6.1.1.1847</CRMVersion>
  </ServerInformation>
</CrmScriptErrorReport>

<CrmScriptErrorReport>
  <ReportVersion>1.0</ReportVersion>
  <ScriptErrorDetails>
   <Message>Unable to get property 'get_element' of undefined or null reference</Message>
   <Line>1158</Line>
   <URL>/_common/JsProvider.ashx?ids=1759665639-1968334880-202661451-1194605645-1039841082-1793205875-1314140682-1547461133-1992083491-1000289424-159335543-1376927455-1030632819-1181113682-1380222012-513446117-1625018438-1460109179-1088147315-706656670-232397045-468302605-1405388298-1731109441-2029667886-202888856-342519603-542820515-1946640899-1603536461-1220618931-511599809-1264077421-1188909594-783705869-374257838-1463979649-1391165063-1359517414-1781702827-2050812538-512064351&ver=-795932359</URL>
   <PageURL>/_forms/read/page.aspx?dpLoaded_1=true&etc=2&id=%7baa30aa9f-2c76-e411-93f6-0003ff437dbf%7d&pagemode=iframe&postcode_4=true&theme=Outlook15White</PageURL>
   <Function>anonymousr:Unabletogetproperty'get_element'ofundefinedornullreference</Function>
   <CallStack>
    <Function>anonymousr:Unabletogetproperty'get_element'ofundefinedornullreference</Function>
   </CallStack>
  </ScriptErrorDetails>
  <ClientInformation>
   <BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.3; WOW64; Trident/7.0; .NET4.0E; .NET4.0C; .NET CLR 3.5.30729; .NET CLR 2.0.50727; .NET CLR 3.0.30729; InfoPath.3; McAfee; MALNJS)</BrowserUserAgent>
   <BrowserLanguage>en-US</BrowserLanguage>
   <SystemLanguage>en-GB</SystemLanguage>
   <UserLanguage>en-GB</UserLanguage>
   <ScreenResolution>1242x698</ScreenResolution>
   <ClientName>Web</ClientName>
   <ClientTime>2014-12-09T21:47:19</ClientTime>
  </ClientInformation>
  <ServerInformation>
    <OrgLanguage>1033</OrgLanguage>
    <OrgCulture>2057</OrgCulture>
    <UserLanguage>1033</UserLanguage>
    <UserCulture>2057</UserCulture>
    <OrgID>{A051A28B-475C-4377-827B-4AC5E0F84687}</OrgID>
    <UserID>{B7C0982B-673E-E411-8100-D89D67632EAC}</UserID>
    <CRMVersion>6.1.1.1847</CRMVersion>
  </ServerInformation>
</CrmScriptErrorReport>

*This post is locked for comments

I have the same question (0)
  • Royal King Profile Picture
    27,686 on at

    it looks like you are passing custom parameters as query string , Did you add all these custom parameters in the Activity form  properties ?  CRM does not like unknown parameters passed using query string.

    Add all your custom parameters to the form properties and check the behavior.

    Here are the steps to pass the custom parameters:

    Step-1: Add parameters in Email Entity Form.

    img

  • Community Member Profile Picture
    on at

    Thanks Chitrarasan but as i mentioned above, i have created all the parameters in the form and when i step through the code i can see they are returning the value. All the functionality works fine when i ignore the error dialog but the main issue is that even though all is working fine, i cant seem to get rid of the mentioned error

  • Royal King Profile Picture
    27,686 on at

    Can you add  some character afte "_" in your custom parameter name something like fullname_a ?Fullname,parentcustomerid,parentcustomeridname and parentcustomertype  are system attribute names and I suspect that might be causing the issue.

  • Community Member Profile Picture
    on at

    Hi Chitra. That's not the issue as all parameters have the character after _

    The parameters in the code above are a sample of what I have but all parameters are correct on the form, each is passing or receiving data correctly.  But something seems broken somewhere before the custom activity form load hence the error

  • Verified answer
    Prati Profile Picture
    980 on at

    Hello Zazujones ,

    This is a notification window ,  Please Follow the steps on the link

    blog.eastridge.net/remove-script-error-notifications-in-dynamics-crm-2013

    Thanks and Regards

    Prashant T

  • Royal King Profile Picture
    27,686 on at

    I can't think of anything else that would cause javascript error. Other option is rather than passing all the values in query string you could access data from the parent window using

    Using below code you can access all the fields from where you are opening new window.

    window.parent.Xrm.Page.getAttribute("")

  • Community Member Profile Picture
    on at

    Thanks Prashant, That works by hiding the notification but doesn't solve the underlying problem.  For now I can live with that. Many thanks.

  • Community Member Profile Picture
    on at

    Thanks Chitra. I will try that but for now I will use suggestion by Prashant to hide the notification as all parameter and other functionality works fine except for the notification. Many thanks.  I will however test your suggestion and see if can stop the error

  • Suggested answer
    Deepesh161 Profile Picture
    6,317 on at

    I was just going through this post when I remembered I had witnesses this before:

    dynamicsofdynamicscrm.wordpress.com/.../new-scripting-referencevariants-of-xrm-utility-openentityform-for-dynamics-crm-2013

  • Community Member Profile Picture
    on at

    Thanks Deepesh. I had actually used that sample and got the same notification pop up. For now i will settle on hiding it as i cant seem to fully get to the bottom of its cause.

    Many thanks

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
JS-09031509-0 Profile Picture

JS-09031509-0 3

#2
AS-17030037-0 Profile Picture

AS-17030037-0 2

#2
Mark Eckert Profile Picture

Mark Eckert 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans