How to hide Compose Email in HR Agent Workspace?

miro2
Mega Sage

Hi,

Does anyone know if there is an option to hide the 'Compose Email' in Workspace? The onload script hides the email icon in UI16. I'm looking for a similar implementation to do the same in HR Agent Workspace. In my use case, when the HR case state is 'Closed Complete,' the agent shouldn't be able to send emails.

 

miro2_0-1715980768655.png

 

function onLoad() {
    var caseState = g_form.getValue('state');
    if (caseState == '3') // Closed complete
    {
        $('email_client_open').hide();
    }
}

 

I tried to control it via the email client attribute set to false, but I can't control it conditionally (when the HR Case state changes to 'Closed Complete'). With this attribute, I can only hide compose email when it is set to false.

 

miro2_1-1715981238071.png

 

14 REPLIES 14

Hi @Gangadhar Ravi thank for your reply
Setting the email client to false hides the 'Compose Email' option entirely. But I'd like to hide it conditionally only when the HR Case status is changes to closed complete.

Community Alums
Not applicable

Hi @miro2 ,

Plese check below link may be this will work for you

https://www.servicenow.com/community/hrsd-forum/how-to-remove-quot-email-quot-section-from-compose-p...

https://www.servicenow.com/community/developer-forum/hide-compose-email-button-when-record-is-inacti...

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

Hi @Community Alums thanks for you reply

Mentioned threads solve this in UI16 or hide it entirely using the Email client attribute setting to false. So, none of these help me with my requirement (hiding it conditionally when HR Case state changes to closed complete).

Anupriya23
Tera Contributor

Did you find anyways to hide it. I was checking for similar requirement.

Hi @Anupriya23 
please check this thread where this topic was also discussed