web
You’re offline. This is a read only version of the page.
close
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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 108 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans