Email_client_open.hide() is not working

Sofia Belber
Tera Contributor

I'm trying to hide the email_client envelope button when the request is in certain states, so I created an onLoad Client Script using the email_client_open.hide() function but is not working. Browser console is saying '$ is not a function'. The  email_client attribute is enabled on my table and I saw that this particular one is called by $email_client_open.

SofiaBelber_0-1679582325803.png

SofiaBelber_1-1679582367102.png

 

 

 

function onLoad() {
	
    var state = g_form.getValue('state');
     if ((state == 3 || state == 17 || state == 20)) {
        try {
            if ($('email_client_open')) {
                ($('email_client_open').hide());
            }
        } catch (ex) {

            jslog('Policy tpc Request OnLoad Fail: ' + ex.toString());
        }
    }
}

 

 

 

I need help figuring out why its not working and/or find a new solution to hide it on particular cases. Please help!!!!!!

 

 

5 REPLIES 5

Sonu Parab
Mega Sage
Mega Sage

Hello @Sofia Belber , Have a look this post 

Hiding email client icon/button for Closed Incidents 

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thank you

Hi Sonu, thank you for taking your time. That the post I used in first place to create the Client Script, everything is the same but its still not working...

SANDEEP28
Mega Sage

HI Sofia,

Your script is correct. Make sure that ISOLATED SCRIPT is UNCHECKED.

I tried your script by unchecking "Isolate script" checkbox on onLoad client script, then it worked. I no longer see "Email" button under more option.

 

If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!

 

SANDEEP28_0-1679595388629.png

 

If you don't see "Isolate script" checkbox field on form, then add it form and then make it false. By default, system automatically check this checkbox.