Welcome to Community Week 2025! Join us to learn, connect, and be recognized as we celebrate the spirit of Community and the power of AI. Get the details  

How to add email icon in ui action button

viraj4
Giga Contributor

How to add email icon in UI action button??

1 ACCEPTED SOLUTION

Got it , below script works for me in my PDI

function onLoad() {

transformButton('email_incident', '#FF0000', 'white', 'icon-mail');

}

function transformButton (buttonID, buttonBackgroundColor, buttonTextColor, buttonIconName)  {
try{
//Find the button(s) by ID and change the background color
$$('button[id=' + buttonID + ']').each(function(elmt) {
elmt.style.backgroundColor = buttonBackgroundColor;
if(buttonTextColor){
elmt.style.color = buttonTextColor;
}
if(buttonIconName){
elmt.addClassName(buttonIconName);
//Add some spacing between the icon and button label
elmt.innerHTML = ' ' + elmt.innerHTML;
}
});
}catch(e){}
}

View solution in original post

23 REPLIES 23

Omkar Mone
Mega Sage

Hi Omkar,

I have checked the link previously but I suppose I missing something could you please help with the script.

Thanks in advance!!

Viraj

Hi 

Can you paste your script here?

Hi Omkar,

Please find the code below -

----------------------------------------------------------------------------------------------------------------------------------

function onLoad() {


var a = document.getElementById('sys_id'); // here I am using the sys_id


if(a)
{
//a.style.background='White';
a.style.color='red';

if(icon-mail){
elmt.addClassName(icon-mail);
elmt.innerHTML = ' ' + elmt.innerHTML;
}

}
}

Thanks,

Viraj