Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Javascript error after migration CRM 2016

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

  • Verified answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,399 on at
    RE: Javascript error after migration CRM 2016

    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

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: Javascript error after migration CRM 2016

    Hi,

      have a look at this thread:

    community.dynamics.com/.../647546

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Javascript error after migration CRM 2016

    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;

    }

    }

    }

    }

    }

  • Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,399 on at
    RE: Javascript error after migration CRM 2016

    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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans