The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Macro visibility in service Operation Workspace

NeethuB
Tera Contributor

I have created a macro:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
        <j2:set var="jvar_n" value="getUserAssets_${ref}" />
 
        <a id="${jvar_n}" onClick="getUserAssets()" title="Lookup user assets" alt="Add me" tabindex="0" class="btn btn-default icon-hardware"></a>
 
        <script>
            function getUserAssets() {
                var callerId = g_form.getValue('caller_id');
                if (!callerId) {
                    alert("Please select a Caller first.");
                    return;
                }
                var refurl = reflistOpenUrl('incident.cmdb_ci', 'incident.cmdb_ci', 'cmdb_ci', 'cmdb_ci', 'null', 'false', '');
 
                var url = 'assigned_to=' + callerId;
                var refurlquery = refurl + url;
 
                popupOpenStandard(refurlquery, 'lookup')
 
 
 
            }
        </script>
 
</j:jelly>
this is visible in the native view and when i changed the view to sow in native view its visible but when i go to Service Operation workspace the incident form doesn't have the macro there
1 REPLY 1

Ankur Bawiskar
Tera Patron
Tera Patron

@NeethuB 

UI macros won't work on workspace.
I could see already that icon is present in workspace.

For workspace to show icons, you need to use Field Decorators

UI Builder Deep Dives: Field Action Decorator 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader