How to get UI Macros working in Workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2022 04:12 PM
In Classic UI, we have places where icons (UI Macro) are next to reference fields. When pressed upon, some action takes place.
In Workspace, the icon doesn't appear and as such, our users are not able to use the functionality that was given by the button.
The icon button acts as a shortcut to perform certain actions. We'd like to have this icon button next to the field if possible. Is there a way to enable this or an alternative approach?
Example of the icon is attached.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2022 09:56 PM
Hi,
As per ServiceNow team it's not possible now.
They might come up with something in later releases.
If my response helped please mark it correct and close the thread so that it benefits future readers.
regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2022 06:16 AM
Hi Jamy,
UI Macro has Jelly content which does not execute in the workspace UI(seismic UI). You can sometimes use action assignments(sys_declarative_action_assignment) for this purpose based on your requirement. You should able to achieve your functionality using this component.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Supriya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2024 06:48 AM
You can use a Field decorator
Here's how it works:
basically it's Client side Javascript. You can, via AJAX, call backend code. But usually you will only get back a few attributes, certainly not a full record.
on the field decorator record you define the table, field and icon to be used
You will then need a web Function script include (sys_script_include.list)
example: fill out primary contact
code on the Field decorator
getPrimaryContact: function() {
var account = this.getParameter('account'); // retrieve passed parameter
var glAccount = GlideRecord('customer_account');
glAccount.get(account);
return glAccount.getValue('primary_contact');
},