
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2018 12:41 PM
I have a request to allow users to reassign an approval after it has been requested.
I couldn't find any OOB functionality that is like this, so I figured I have to make my own UI action.
I am trying to think of the best way to do this. Ideally, when the button is clicked I would like a pop up to appear with a reference field for the user table, and then when they submit, the approval will be reassigned to this value.
I have made a UI action with a client side pop up window before, but it only had plain text. How can I make a "mini form" appear as a pop up?
I'm looking for any help with this, or im open to any alternate suggestions!
thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-01-2018 10:33 AM
I created a basic UI page, and script include to make the change to the approval record.
Here are the details. the items in BOLD will change based on what you name the records.
UI ACTION:
function popupWindow() {
var dialog = new GlideDialogWindow('x_25054_reassign_a_Reassign approval');
dialog.setTitle("Approval Re-assign");
dialog.setSize(500,225);
dialog.adjustBodySize();
dialog.render();
return false;
}
UI PAGE:
HTML -
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<h2 >Re-assign this approval</h2>
<g:ui_form>
<tr><td>Re-assign to: </td><td><g:ui_reference name="newUser" table="sys_user" completer="AJAXTableCompleter" columns="first_name" /></td></tr>
<tr><td></td></tr>
<g:dialog_buttons_ok_cancel ok="validateChanges();" cancel="processCancel();" ok_type="button" cancel_type="button" />
</g:ui_form>
</j:jelly>
CLIENT SCRIPT -
function validateChanges(){
var user = gel("newUser").value;
var id = gel('sys_uniqueValue').value;
GlideDialogWindow.get().destroy();
var ga = new GlideAjax('reAssignApprover');
ga.addParam('sysparm_name', 'reAssign');
ga.addParam('sysparm_user', user);
ga.addParam('sysparm_id', id);
ga.getXML();
}
function processCancel(){
GlideDialogWindow.get().destroy();
}
SCRIPT INCLUDE:
var reAssignApprover = Class.create();
reAssignApprover.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
reAssign: function(){
var user = this.getParameter('sysparm_user');
var id = this.getParameter('sysparm_id');
var gr = new GlideRecord('sysapproval_approver');
gr.get(id);
gr.query();
while(gr.next()){
gr.setValue('approver',user);
gr.update();
}
gs.addInfoMessage('This approval record has been re-assigned');
},
type: 'reAssignApprover'
});
Hope this helps. let me know if you still need some help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2018 09:22 AM
@kgilmartin I created what you are looking in my personal instance and it seems to be working.
below are the details. maybe login and take a look in this instance. This might help you if you can see a working example.
https://dev67075.service-now.com
I created use a user account
UserID = "admin2"
password = 'password'
Let me know if you are able to figure out the problem. if not then we can setup a webex to help you figure it out.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 11:05 AM
Hello,
I'm sorry - we had a lot of other projects come up and this kind of got swept under the rug. The dev instance you provided is asleep now, Are you able to wake it up without needing to reconfigure everything? If not, no worries, I don't want you to have to configure it again.
Also, I had a question about your original post. Is the script include code supposed to be part of the ui page, in the 'processing script' field? I originally made a new script include separate from the ui page, and im wondering if thats the issue.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 11:39 AM
Nevermind...I found the issue. my function was called 'reAssign' and I passed the value 'reassign' ....sigh
thank you so much for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-10-2018 12:24 PM
Hey Kgilmartin, I am glad you were able to find the problem. Hope I was able to help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2023 07:51 PM
Hello @Inactive_Us1180
I have a work requirement where I need to do the same function like the code you have shared.
My requirement is to get the new approver inserted not update.
I got stuck with the Script Include part where the record did not get insert.
Could you please help? Than you