Field decorations / Reference contributions not working for certain (reference) field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 02:34 AM
Hi,
I have a working UI Macro on the incident form which sets the assignment group field to the support group of the currently selected CI.
When I add it as field decoration / reference contribution to for example the customer (reference) field, it shows on the form, and does exactly what I want it to do.
When I add it to the assignment group (reference) field, it does not show.
Does anyone have an idea how to fix this?
With kind regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 02:59 AM
Hi,
you will have to change the logic within the macro since both the fields to which you are adding the macro are different
one refers to customer table and other refers to group table
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
‎04-01-2022 03:01 AM
It renders for most fields, except for assignment_group. I think this has nothing to do with it not rendering.
This is my UI 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">
<j:set var="jvar_n" value="add_support_group"/>
<span id="${jvar_n}" onclick="addSupportGroup()" title="Add Support Group" alt="Add Support Group" tabindex="0" class="btn btn-default icon-user-group">
<span class="sr-only">Add Support Group</span>
</span>
<script>
function addSupportGroup() {
var supportGroup_id = g_form.getReference('u_reported_ci').support_group;
var supportGroup = new GlideRecord('sys_user_group');
supportGroup.get(supportGroup_id);
var sys_id = supportGroup.sys_id;
if(supportGroup){
g_form.setValue('assignment_group', sys_id);
}
}
</script>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 03:03 AM
Hi,
this is added to which field?
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
‎04-01-2022 03:04 AM
It works for most fields, for example u_reported_ci and u_customer, but not for the field assignment_group on which I wanted to add it in the first place.