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)

Javascript error after migration CRM 2016

(0) ShareShare
ReportReport
Posted on by

Hey guys!

We migrated CRM 2016 last friday and now everytime we click on a contact we see this error message.

pix1.PNG

and

pix2.PNG

Here is also log files for both pictures above

1)

TypeError: Unable to get property 'children' of undefined or null reference
   at deleteActivitiesTab (ahcrm.hdsaas.com/.../ah_DeleteActivitiesTab)
   at eval code (eval code:1:1)
   at RunHandlerInternal (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at RunHandlers (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at OnScriptTagLoaded (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at Anonymous function (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)

2)

TypeError: Unable to set property 'onclick' of undefined or null reference
   at filterAllActivities (ahcrm.hdsaas.com/.../ah_AllActivities)
   at eval code (eval code:1:1)
   at RunHandlerInternal (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at RunHandlers (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at OnScriptTagLoaded (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)
   at Anonymous function (ahcrm.hdsaas.com/.../ClientApiWrapper.aspx)

I checked - codes on both versions 2013 and 2016 are exactly the same

*This post is locked for comments

I have the same question (0)
  • Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    Please check the web resources (JavaScript files) used in contact form (ah_DeleteActivitiesTab and ah_AllActivities)

    and find out the JS statements which uses

    children

    onclick

  • Community Member Profile Picture
    on at

    I just checked but everything seem to be fine

    onLoad: function HideActivities() {

    var ctrlElement = document.getElementById(“header_notescontrol”);

    if (ctrlElement.children != null && ctrlElement.children.length > 0) {

    for (var ele = 0; ele < ctrlElement.children.length; ele++) {

    var ctrl = ctrlElement.children[ele];

    if (ctrl.title == “ACTIVITIES”) {

    ctrl.style.display = “none”;

    if (ele + 1 < ctrlElement.children.length) {

    ctrlElement.children[ele + 1].click();

    return;

    }

    else if ((ele – 1) >= 0) {

    ctrlElement.children[ele – 1].click();

    return;

    }

    }

    }

    }

    }

    and

    function deleteActivitiesTab() {

    var ctrlElement = document.getElementById("header_notescontrol");

    if (ctrlElement.children != null && ctrlElement.children.length > 0) {

    for (var ele = 0; ele < ctrlElement.children.length; ele++) {

    var ctrl = ctrlElement.children[ele];

    if (ctrl.title == "ACTIVITIES") {

    ctrl.style.display = "none";

    if (ele + 1 < ctrlElement.children.length) {

    ctrlElement.children[ele + 1].click();

    return;

    }

    else if ((ele - 1) >= 0) {

    ctrlElement.children[ele - 1].click();

    return;

    }

    }

    }

    }

    }

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi,

      have a look at this thread:

    community.dynamics.com/.../647546

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    Hi

    You are using unsupported way of customization (accessing HTML DOM elements using ids).

    The element ids might have changed or so.

    Please convert your code by using SDK Library (Xrm.Page or Xrm.Utility namespaces).

    Please refer the following (read the Important note at the top):

    msdn.microsoft.com/.../gg328255.aspx

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