Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

ReferenceError: xxx is not defined at eval (eval at RunHandlerInternal

Posted on by 26

Hi 

I am using Dynamics 365 on premises and am trying to hide a subgrid based on a check box and am using the following code:

function checkBoxShowTab() {

try {

var checkbox = false:

var check = Xrm.Page.getAttribute("new_kinegrampatch");

if (check != null)

{

checkbox = check.getValue();

}

if (checkbox)

{

Xrm.Page.ui.controls.get("SubFeatures").setVisible(true);

}

if (!checkbox)

{

Xrm.Page.ui.controls.get("SubFeatures").setVisible(false);

}

}

catch (e) {

Xrm.Page.ui.setFormNotification(e.message, "WARNING", "Exception");

}

When the check box is ticked, I get the following error:

pastedimage1578482388835v1.png

Can anybody point out where I am going wrong as I am new to js.

thanks

  • erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: ReferenceError: xxx is not defined at eval (eval at RunHandlerInternal

    I am glad it worked, please verify the answer if it helped. Thanks.

  • AlexMurphy Profile Picture
    AlexMurphy 26 on at
    RE: ReferenceError: xxx is not defined at eval (eval at RunHandlerInternal

    Thanks made the changes and it all works. thanks for your help

  • Verified answer
    Vipin J Profile Picture
    Vipin J 1,583 on at
    RE: ReferenceError: xxx is not defined at eval (eval at RunHandlerInternal

    Hi Alex,

    There is a Typo Error as pointed correct by : Erhan

    Refer here few article for java scripting in Dynamic CRM. Do also let me know if you have any of those of your own.

    I would be happy to update article.

    https://vjcity.blogspot.com/2019/12/most-common-javascript-methods-for.html

    https://vjcity.blogspot.com/2019/08/guidelines-to-write-good-javascript.html

  • Verified answer
    erhan.keskin Profile Picture
    erhan.keskin 2,247 on at
    RE: ReferenceError: xxx is not defined at eval (eval at RunHandlerInternal

    var checkbox = false:

    is this a typo?

    and i don't see the last "}" for the function itself.

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