Popup for Standard Change Proposal Approvals

StewartF
Tera Expert

We've had a request in to have a pop-up come up when it comes to approving a new Standard Change Proposal, but unsure exactly how to achieve this.

 

It needs to appear when the approving user clicks into the approval record in the system, and it's more of anacknowledgement message than anything.

 

It needs to only appear when it's a Standard Change Proposal, and the State of said proposal is 'In Progress'.

 

I've seen GlideModal and UI Pages used to achieve a pop-up when a user tries submitting a new template without linking the correct number of sample Change Requests, but usure how I'd get that to work for the approval screen OnLoad.

 

Any help anyone can give please?

6 REPLIES 6

Kieran Anson
Kilo Patron

An approval record for a standard change has the 'source_table' set to [std_change_proposal]. You could use an onLoad client script to check this field, and if the above value is present, use GlideModal to present a UI page, and go about any other logic you need.

Hi Keiran,

 

That's what I've been trying to do but I can't get it to work. I'm not a competent scripter so it's 95% likely I'm just not doing it correctly! I've just taken one that's on the Standard Change Template and tried to amend it -:

 

function onLoad() {
   //Type appropriate comment here, and begin script below
   if (source_table == 'std_change_proposal') {

 var gm = new GlideModal('sif_glidemodal_stdchng_popup');
        gm.setTitle('Alert');
        gm.renderWithContent('Confirm this.');
        gm.render();
        //g_form.getControl('select_0std_change_proposal.change_requests').focus();
       
        return true;
} else {

    return false;
}
}
Any thoughts/advice? Would be greatly appreciated

Is sif_glidemodal_stdchng_popup something you've created? Are you ok to share the HTML/Client script for review. 

Hi Keiran,

 

So the above script is the client script, and it calls a UI Page called sif_glidemodal_stdchng_popup.


That Jelly script is below - but this is copyt/paste from an existing one that works, and I just changed the wording that appers just while I tested.

 

<?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:ui_form>
 <div style="text-align:center;">

<div class="alert alert-danger" style="font-size:18px;">
<p style="margin-bottom:15px;">'Confirm that you understand the following.</p>
<button class="btn btn-default btn-md" style="margin-right:5px;" id="ok_button" onclick="okSubmit()" type="button">Ok</button>
 </div>
 </div>
 </g:ui_form>
</j:jelly>