Email_client_open.hide() is not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 07:40 AM
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.
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!!!!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 10:25 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 10:55 AM
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...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 11:18 AM
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 !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 11:23 AM
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.