Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Button On Record Page

CoreyBrown
Contributor III

Hello all,

 

I am trying to add a custom button to the top of the record page, near the "Add", "Export", and "Email" buttons. I have the button working, but I'm stuck on one minor thing. I cannot figure out how to add an icon to the button so that it isn't just text. I would like for it to blend in to keep a consistent look and feel to the page. 

 

I put an example of how the button is made below, using everyone's favorite button - the copy button! Does anyone know how to get an icon in there instead of text? Specifically, in this example, I would like to put the "FileCopy" icon from Material Icons - Material-UI  in the data-icon attribute. 

 

<script type="text/javascript">
var copyIcon = 'copy';
$('#master_btnAdd').clone().attr({'id': 'master_customBtnCopy', 'title': 'Copy', 'onclick': 'javascript:__doPostBack("master$btnCopy","");return false;'}).insertAfter('#master_btnAdd');
$('#master_customBtnCopy').children().attr('data-icon', copyIcon);
</script>

1 ACCEPTED SOLUTION

Accepted Solutions

DavidPetty
Archer Employee
Archer Employee

Corey, I don't think we're using Material Icon yet within the record but you can use the old icon set.

<script type="text/javascript">
var copyIcon = '&#xE088';
$('#master_btnAdd').clone().attr({'id': 'master_customBtnCopy', 'title': 'Copy', 'onclick': 'javascript:__doPostBack("master$btnCopy","");return false;'}).insertAfter('#master_btnAdd');
$('#master_customBtnCopy').children().attr('data-icon', copyIcon);
</script>

Which should give you

pastedImage_1.png

 Advisory Consultant

View solution in original post

2 REPLIES 2

DavidPetty
Archer Employee
Archer Employee

Corey, I don't think we're using Material Icon yet within the record but you can use the old icon set.

<script type="text/javascript">
var copyIcon = '&#xE088';
$('#master_btnAdd').clone().attr({'id': 'master_customBtnCopy', 'title': 'Copy', 'onclick': 'javascript:__doPostBack("master$btnCopy","");return false;'}).insertAfter('#master_btnAdd');
$('#master_customBtnCopy').children().attr('data-icon', copyIcon);
</script>

Which should give you

pastedImage_1.png

 Advisory Consultant

Thank you! I didn't even think to use the old set.