- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2019 01:23 AM
How to add email icon in UI action button??
Solved! Go to Solution.
- Labels:
-
Multiple Versions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 02:34 AM
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){}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 12:26 AM
Hi Omkar,
Please find the updated code -
------------------------------------------------------------------------------------------------------------
function onLoad() {
transformButton('3c0e15aadb2800d079327abe3b9639ae', '#FF0000', 'red', 'icon-mail');
}
function transformButton('3c0e15aadb2800d079327abe3b9639ae', '#FF0000', 'red', 'icon-mail') {
try{
//Find the button(s) by ID and change the background color
$$('button[id=' + buttonID + ']').each(function(elmt) {
elmt.style.backgroundColor = buttonBackgroundColor;
if(red){
elmt.style.color = red;
}
if(icon-mail){
elmt.addClassName(icon-mail);
//Add some spacing between the icon and button label
elmt.innerHTML = ' ' + elmt.innerHTML;
}
});
}catch(e){}
}
Thanks,
Viraj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 12:36 AM
Hi
Not the sys_id, the id of element which get after inspecting it the console by f12.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 01:48 AM
Hi
I checked twice and after inspecting i can find sys_id mentioned as the Id in the console.
Thanks
Viraj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 01:54 AM
Hi
You dont need sys_id, check my code, approve there is the id of HTML Ui Action,as i have even attached the screentshot of the html id that i have referred to for the Ui Action.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2019 02:10 AM
Hi
I updated the UI action name and got the ID as email_incident.
Still I face the issue on executing the below script.
function onLoad() {
transformButton('email_incident', '#FF0000', 'red', 'icon-mail');
}
function transformButton('email_incident', '#FF0000', 'red', 'icon-mail') {
try{
//Find the button(s) by ID and change the background color
$$('button[id=' + buttonID + ']').each(function(elmt) {
elmt.style.backgroundColor = buttonBackgroundColor;
if(red){
elmt.style.color = red;
}
if(icon-mail){
elmt.addClassName(icon-mail);
//Add some spacing between the icon and button label
elmt.innerHTML = ' ' + elmt.innerHTML;
}
});
}catch(e){}
}