Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

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

(0) ShareShare
ReportReport
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
    2,253 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
    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
    1,603 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
    2,253 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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans