How can I format a UI Macro to add icon next to URL field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 06:59 PM
I'd like to be able to display icons for various social media sites next to URL fields on a form (bonus if the icon works like a button to open a new browser tab). I've worked with UI Macros to display buttons next to reference fields, but so far I haven't had any luck doing the same with URL fields, and honestly not sure it's possible the same way.
Things like call me or MS Teams buttons have been easy enough to set up (excuse the button formatting, just threw together to test).
Has anyone done something similar for non-reference fields and can provide some advice on the correct way to implement?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-12-2022 07:05 PM
Hi
You need to add an attribute "ref_contributions=your_macro_name" in the dictionary of the field where you want to see.
Replace "your_macro_name" with the name of the macro.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 09:32 AM
I've set the ref_contributions in the dictionary of the field, but it never displays unlike the same macro set in the attributes of a reference field. I've seen where some people mention using "field_decorations" instead, but that also doesn't work.
It could be something in the Jelly script that I'm not doing correctly since it's not my strong suit. I've been looking at other macros to see if I notice anything, but so far not much luck.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2022 10:01 AM
You need to create the UI Macro and define the the icon there, among other things. Then on the target field, update the dictionary settings to add "ref_contributions=macro_name_here".
It is even possible to add further conditions so that the button only shows for certain conditions/values.
Here's an excerpt from a UI Macro I have for invoking a Teams message from Incident records. This is what I am using to generate the button:
<j2:while test="$[gr.next()]">
<j:set var="jvar_n" value="show_teams_${jvar_guid}:${ref}"/>
<a id="${jvar_n}" onclick="invokeChat('${ref}');" title="Open Teams Chat" class="icon ref-button icon-collaboration btn btn-default btn-ref"/>
</j2:while>
Of course, I've never tried this with an actual URL field, but I don't see why it would behave any differently.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2022 08:28 AM
Hi MHager,
I am working on a requirement to add UI Macros beside the caller field. I have created the UI macros and the functionality is working correctly but 'Preview this record' icon is coming up in the next line as shown in your screen shot. Can you help me on how to change the placement of that so that it comes up in the same line as the other icons(beside the field).
Thank you.