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 04:24 AM
Hi,
any error in browser console when form loads?
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 04:29 AM
No.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 05:00 AM
try to remove the UI macro from other 2 fields and just keep assignment group and check if it works
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 05:06 AM
I already tried that but it does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-01-2022 05:44 AM
can you share the browser console when form loads?
Did you try creating fresh UI macro with different name, same code and replace with this and try once
use this to create new macro and add this one
I have changed the function name
addSupportGroup1()
<?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="addSupportGroup1()" 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 addSupportGroup1() {
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>
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader