Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Error occurred in javascript onchange event calls automatically on onload event

Posted on by 425

Hi guys,


I am facing new error in service module onload event and onchange event in Case entity.
And also i am using crm online version 9.1 
Below script:-

function BusinessSwitch()
{
debugger;
alert("Hello");
}

Alert message was displyed and later after few seconds new message displays like below shown.

Below Image refers the error for above script:

3343.image-of-error-call.png

Please guide me to solve this issue.

*This post is locked for comments

  • Suggested answer
    naresh babu Profile Picture
    naresh babu 425 on at
    RE: Error occurred in javascript onchange event calls automatically on onload event

    Solved

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Error occurred in javascript onchange event calls automatically on onload event

    Can you please close the thread by verifying useful answer , this may helps others in future.

  • naresh babu Profile Picture
    naresh babu 425 on at
    RE: Error occurred in javascript onchange event calls automatically on onload event

    It was solved.

    No error in script or solution.

    The Legacy "use legacy form rendering" was enabled. I disbaled it. That's all

    Thanks for guiding me.

  • naresh babu Profile Picture
    naresh babu 425 on at
    RE: Error occurred in javascript onlad event

    Yeah, There is another function running on change event.

    But now i am getting error on load of form.

    I tried with this scenario:- I kept different alerts on onchange event function and another on onload event function.

    When the form is refreshed. I am getting both alerts(onload and onchange event function alerts).

    onchange Event:-

    function getOrderId()
    {
    debugger;
    var orderid = Xrm.Page.getAttribute("new_order").getValue()[0].id;
    if(orderid != null)
    {
    alert(orderid);
    //var Id = orderid[0].id;
    getOrder(orderid);

    }
    }

    onload Event:-

    function BusinessPSwitch()

    {

    alert("Hello");

    }

     

    I am getting both alerts on page refresh only.

     

     

  • gdas Profile Picture
    gdas 50,085 on at
    RE: Error occurred in javascript onlad event

    Hi ,

    When you are saying that   you can see the alert that means that everything is fine with the event for this function and the error is coming from somewhere else . Do you have any other function which is calling onchange event or in the webresource library.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans