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

  • 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

  • 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

  • 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.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 247

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 166 Super User 2025 Season 2

#3
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 164

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans