We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Hiding email client icon from scope application custom table

PravinBangadkar
Tera Contributor

Hi Team,

 

I want to Hide email client icon from scope application custom table. I have write the script and made isolated script checkbox as false. But its not working in scoped application.

 

function onLoad() {

   var apr = g_form.getValue('approved'); //True/false field type

    if (apr != 'true') {

        $('email_client_open').hide();

    }

}

 

Its going inside the if condition but still its not working. Please suggest any solution or insides.

 

Thanks in advance.

5 REPLIES 5

Ankur Bawiskar
Tera Patron

@PravinBangadkar 

you are using DOM manipulation.

Is "Isolate Script" field false for your client script to allow DOM?

try this

$j('#email_client_open').hide();

AnkurBawiskar_0-1770819143914.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar , I have tried this $j('#email_client_open').hide(); solution but not wokring.  Do you have any other approch?.

@PravinBangadkar 

how about this?

Is "Isolate Script" field false for your client script to allow DOM?

AnkurBawiskar_0-1770820060483.png

Also give some timeout in your script, may be that 3 dots not loading immediately after form loads

function onLoad() {

    setTimeout(function() {
        var apr = g_form.getValue('approved'); //True/false field type
        if (apr != 'true') {
            $j('#email_client_open').hide();
        }
    }, 2000);

}

Isolate Script in London -> See if DOM is blocked in your scoped app via that "glide.script.block.client.globals" property

Create a system property in your scoped app with this and set value as false

AnkurBawiskar_1-1770820290502.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@PravinBangadkar 

Hope you are doing good.

Did my reply answer your question?

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader