- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2015 12:14 PM
Is there an easy way to display Form Sections on Approval Summarizers?
I have a custom table (exteneded from task), for which I've created a custom Approval Summarizer UI Macro for. The only problem is, by default fields that are displayed in a Form Section in the default view are not displayed on the Approval Summarizer. These fields are not inherited from Task; they are native to the custom table
I've read every Wiki doc and Community post I can find regarding summarizers, but can't seem to piece together how this can be accomplished without coding an entirely new summarizer (as done here)
Any quick and easy way to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2015 10:29 AM
Why dont you create a separate view where you will have all your fields in main section. Then mimic the Approval Summarizer macro to call that view instead of Default view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 10:51 AM
While its good to know this will work as a workaround, it isn't really ideal since we loose the ability to display the information the way we want to.
Has anyone found a way to show all sections as original requested? Or alternatively to provide a pop-up that will show the full form?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2015 11:46 AM
To add to this, I have found that approval_summarizer_default doesn't just show you the first segment, but also all of the segments that follow which have a blank segment title. It stops when it hits a segment with a segment with a title.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2015 12:19 PM
Hi Matthew,
Here is the workaround I did using information from the below article:
http://www.servicenowguru.com/system-ui/glidedialogwindow-quickforms/
I customized the "approval_summarizer_default" UI macro to include a "Click here to view the entire record" hyperlink to pop up the full record in a window.
Unfortunately I haven't been able to find a way to show it in the form other than an iframe.
Here is the code for the revised "approval_summarizer_default" UI macro.
Cheers,
- James
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="true" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_has_source" >
var flag = !${ref}.sysapproval.nil() || !${ref}.source_table.nil();
flag;
</g:evaluate>
<j:if test="${jvar_has_source}">
<g:evaluate var="jvar_ni" expression="
var gr = null;
if ( !${ref}.source_table.nil()) {
gr = new GlideRecord(${ref}.source_table);
gr.get( ${ref}.document_id);
} else {
gr = new GlideRecord('task');
gr.get(${ref}.sysapproval);
}
" />
<g:evaluate>
g_approval_form_request = true; // this global is checked in ACLs
</g:evaluate>
<g:evaluate>
var rp_backup = RP;
</g:evaluate>
<j:set var="jvar_TheTableName" value="${gr.getRecordClassName()}" />
<j:set var="jvar_TheSysId" value="${gr.sys_id}" />
<g:evaluate var="jvar_my_form">
var gc = new GlideController();
var p = new GlidePopup(gc, "${gr.getRecordClassName()}");
p.putParameter("sys_id", "${gr.sys_id}");
p.putParameter("sysparm_view", "approval");
//PRB579164: Skip g_form creation in activities.xml if activities displayed in formatter
p.putParameter("sysparm_skip_gform", "true");
var rp = p.getRenderProperties();
rp.setSmallCaption(true);
rp.setInlinePopup(true);
rp.setReadOnly(false);
p.getPopup();
</g:evaluate>
<tr id="approval_summary_row">
<td width="100%" colspan="2">
<j2:if test="${gs.getProperty('glide.security.use_csrf_token')}" >
<input type="HIDDEN" name="sysparm_ck" value="$[gs.getSessionToken()]"/>
</j2:if>
<div id="approval_summary" style="padding-top:8px;display:none;">
<div class="caption" style="padding:4px;">${gs.getMessage('Summary of Item being approved')}</div>
<div style="padding-left:2px;"><div class="form-horizontal"><g:no_escape>${jvar_my_form}</g:no_escape></div></div>
<a onclick="MoreInfo()" href="#"> ${gs.getMessage('Click here to view the entire record')}</a><BR/>
</div>
</td>
</tr>
<g:evaluate>
delete g_approval_form_request; // removes the global
</g:evaluate>
<script>
addRenderEvent(moveSummaryForm);
function moveSummaryForm() {
var e = $("approval_summary");
var form = $("sysapproval_approver.do");
var formParent = form.parentNode;
formParent.appendChild(e);
e.show();
}
function MoreInfo(){
//Create and open the dialog form
//Provide dialog title and table name
var dialog = new GlideDialogForm('More Info', '${jvar_TheTableName}');
dialog.setSysID('${jvar_TheSysId}'); //Pass in sys_id to edit existing record, -1 to create new record
dialog.addParm('sysparm_view', 'ResolveDialog'); //Specify a form view
dialog.addParm('sysparm_form_only', 'true'); //Add or remove related lists
dialog.setLoadCallback(function(iframeDoc) {
// To get the iframe: document.defaultView in non-IE, document.parentWindow in IE
var dialogFrame = 'defaultView' in iframeDoc ? iframeDoc.defaultView : iframeDoc.parentWindow;
dialogFrame.g_form.setValue('close_notes', 'Hello world!');
dialogFrame = null;
});
dialog.render(); //Open the dialog
}
</script>
<g:evaluate>
RP = rp_backup;
</g:evaluate>
</j:if>
</j:jelly>

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-11-2016 11:12 AM
This code works great and looks a lot better than the original summarizer. This is what my management was asking for.
But I have a lot of fields that are sometimes empty and/or hidden from the RITM. I have seen posts where you can modify the summarizer to hide those. But I don't understand the code here. Does anyone know where I could add lines to hide a hidden or empty field in the above? I tried to play around with it, but am not getting it right, since I have no understanding of the code above.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2016 07:39 AM
Yes, I was also looking for the same.. DO we have an option to hide empty variables in approval summarizer.
Thanks!!