How to create an icon next to a caller field which displays caller information in incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 07:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 07:42 AM
This should help you oput.
Please mark my response as correct and helpful if it helped solved your question.
-Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-21-2019 08:40 AM
you can achieve this using UI macro
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2019 12:24 AM
I tried and its showing the related caller information. Please tell me whether the below code is correct.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_guid" expression="gs.generateGUID(this);" />
<j:set var="jvar_n" value="sys_user${jvar_guid}:${ref}"/>
<g:reference_decoration id="${jvar_n}" field="${ref}"
onclick="showCaller_Id('${ref}'); "
title="${gs.getMessage('Preview Caller Record')}" image="images/icons/tasks.gifx" icon="icon-user-selected"/>
<script>
// show related list
function showCaller_Id(reference) {
try {
var displayValue = g_form.getDisplayBox(reference).value;
var title = 'Preview Caller Record: ' + displayValue;
var s = reference.split('.');
var referenceField = s[s.length - 1];
var query = referenceField + '=' + g_form.getValue(reference);
var gdw = new GlideModal('sys_user');
gdw.setTitle(title);
gdw.setSize(750);
gdw.setPreference('focusTrap', true);
gdw.setPreference('table', 'sys_user');
gdw.setPreference('sysparm_query', query);
gdw.setPreference('title', 'A New Title');
gdw.render();
} catch (e) {
jslog('error showing related list');
jslog(e);
}
}
</script>
</j:jelly>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2019 03:43 AM
Hi Muffin,
i have tested this code, it works perfectly fine:
refer below SS:
If this resolves your query, please mark my comments as correct and helpful
.
Regards,
Ajay Chavan