Hiding email client icon/button for Closed Incidents

ramwons
Kilo Expert

Hello,

I want to hide the email client icon/button for the closed incidents only. is it possible?. If yes how can I achieve it.

Thanks,

Ram

1 ACCEPTED SOLUTION

AbhishekGardade
Giga Sage

Hello ram,

Create onLoad Client script as below :

find_real_file.png

 

function onLoad() {
//Type appropriate comment here, and begin script below
var incState = g_form.getValue('incident_state');

if(incState == '7') // 7 is value for closed
{
$('email_client_open').hide();
}
}

Make sure that ISOLATED SCRIPT is UNCHECKED.
New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade

View solution in original post

5 REPLIES 5

dvp
Mega Sage
Mega Sage

removing the write access to closed incidents will automatically disable the email client icon. Try restricting write access to closed incidents

AbhishekGardade
Giga Sage

Users with write access to the current table can see the email icon. To remove the icon, remove the user's write access to the table. Typically you do this in one of two ways:

  • Make the user an Employee Self-Service (ESS) user. ESS users do not have a user role, and without a role they do not have write access to the Incident table. Making a user an ESS users, therefore, hides the email icon on the Incident form.
  • Create a custom ACL rule and user role that does not have write access to the table. The default ACL rule for the email client checks to see if the user has the itil role. If you grant users a custom role other than itil, then any such users will not see the email icon.

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade

asifnoor
Kilo Patron

Hi,

Look at this thread. This might help you.

https://community.servicenow.com/community?id=community_question&sys_id=3a5bc721db9cdbc01dcaf3231f96...

Mark the comment as a correct answer and helpful if this helps.

AbhishekGardade
Giga Sage

Hello ram,

Create onLoad Client script as below :

find_real_file.png

 

function onLoad() {
//Type appropriate comment here, and begin script below
var incState = g_form.getValue('incident_state');

if(incState == '7') // 7 is value for closed
{
$('email_client_open').hide();
}
}

Make sure that ISOLATED SCRIPT is UNCHECKED.
New client-scripts are run in strict mode, with direct DOM access disabled. Access to jQuery, prototype and the window object are likewise disabled. To disable this on a per-script basis, configure this form and add the "Isolate script" field. To disable this feature for all new globally-scoped client-side scripts set the system property "glide.script.block.client.globals" to false.

Please mark as Correct Answer and Helpful, if applicable.
Thanks!
Abhishek Gardade
Hexaware Technologies

Thank you,
Abhishek Gardade