- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2014 05:45 AM
Hi All,
For change management module we are using OOTB UI macro 'approval_summarizer_default' for showing fields in My approvals.
Now I want to add some more fields to that My approvals for that where I have to change in UI macro?
Below is the OOTB code for that
<?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="jvar_my_form">
var gc = new GlideController();
var p = new GlidePopup(gc, "${gr.sys_class_name}");
p.putParameter("sys_id", "${gr.sys_id}");
p.putParameter("sysparm_view", "approval");
var rp = p.getRenderProperties();
rp.setSmallCaption(true);
var s = p.getPopup();
s;
</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;"><g:no_escape>${jvar_my_form}</g:no_escape></div>
</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();
}
</script>
</j:if>
</j:jelly>
See the below screen shot
Here I want to add and remove some fields.For that where I have to change in that UI macro
Solved! Go to Solution.
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2014 06:44 AM
You can use an if statement in the g:evaluate block where the p.putParameter("sysparm_view", "approval"); line is. Just use the gr object to check the user selected value on the change request and pass in the view name for approval.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2014 11:02 PM
Hi All,
Any idea on this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2014 12:38 AM
Hi,
You just have to modify the form layout as Brad said. If you have 2 different views, these will appear on the editing views form. You will see a field called: "View name" which you will find all views that you have available for your current form. If you have 2 differents one (as you said) you just have to hide/show fields from the view that you wish.
To do that make right click on the form title bar (on the top of the form) then Personalize and Form Layout.
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2014 01:00 AM
I am not asking about form fields,I am asking about fields in 'My Approvals'.Please see the screen shot which I provided in my question.
for default view --- in My approvals I want to show some fields
For other view ---- in My approvals I want to show some other fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2014 01:13 AM
Ok so you want to modify the popup which is opened from 'My approval' form, right?
Take a look to next link: Customizing the Reference Icon - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2014 01:25 AM