- 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
‎10-23-2019 09:56 PM
Hi Viraj,
Can you update your script to something like this?
function onLoad() {
transformButton('approve', '#77FF77', 'white', 'icon-success-circle');
//transformButton('inspect the id of your ui action you want to change','color of that action','text color','icon')
}
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){}
}
As mention above the function has these parameters -
transformButton('inspect the id of your ui action you want to change','color of that action','text color','icon');
To inspect the id of your Ui Action check the below Screenshot -
1) Press F12 on your form where Ui Action is present.
2) With the inspector, inspect the ui action for which you want the ID.
3) Put that id in the transformButton function.
4) Check the Isolate Script checkbox on your client script, it should be unchecked.
Hope this helps.
Regards
Omkar Mone
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 12:53 AM
Hi Omkar,
I have tried the above code earlier but somehow I am not able to achieve the result.Could you please help me with the script so that I have the email icon in UI action.
Thanks in advance!!
Viraj

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 12:56 AM
Can you put the updated script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-24-2019 04:19 AM
Hi Omkar,
I have updated the script to
function onLoad() {
transformButton('email', '#77FF77', 'white', 'icon-mail');
}
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2019 08:41 PM
Hi Viraj,
Where is the transformButton function? Can you copy the exact code that i have provided, and in the first parameter of transformButton function can you press f12 and inspect the id of the button where you want to put the icon. I have tried the above script in my instance(the one i have provided) and after that i have out it here. So i know it is working fine.
Regards
Omkar Mone