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

If you want to hide email compose in workspace, you can hide the mini email compose in the UI builder.

But it depends on your requirements. Please share your business needs, will try to help you.

Anupriya23
Tera Contributor

I want to hide this compose email section when HR case and HR task state is closed complete

Hi Sid,

Thanks for sharing but this is to hide UI action completely from a table.

I want to hide the email section in  the activity logs on HR workspace only when state is close complete

A0S1B3T
Tera Contributor

Hi @Anupriya23 ,

 

For hiding email mini compose, you must be seeing below in your Configurable Workspace

A0S1B3T_0-1734593008449.png

Click on Activity stream Compose.. On Right side see the "Advanced section"
Expand the Advance section and you will see below

A0S1B3T_1-1734593133960.png

Hover on Show email mini compose and click on Bind Data icon

A0S1B3T_2-1734593230450.png

It will open a pop-up space to write script... On top left see icon <> to write script

A0S1B3T_3-1734593321984.png

Then add your condition within function such as:

function evaluateProperty({
api,
helpers
}) {
if (api.data.record.form.fields.state.value == 7)
return 'NEVER';
else
return 'ALWAYS';

}