web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    erhan.keskin Profile Picture
    2,253 on at

    var checkbox = false:

    is this a typo?

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

  • Verified answer
    Vipin J Profile Picture
    1,603 on at

    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

  • AlexMurphy Profile Picture
    26 on at

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

  • erhan.keskin Profile Picture
    2,253 on at

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 129 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 46 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 41

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans