How to create UI page with two buttons yes or no when click Approve

Brahmi Pandla
Tera Guru

Hi Everyone,

 

I have a requirement when approver click Approve  need to display dialog box  with two buttons  Yes  and No

with display the content 

"Have all tickets transferred appropriate group"

 

If  click  on Yes request should approve

If click on No state should not change

 

I create UI page with below code for create two buttons

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<div>
  <h2>have all active tickets, tasks, and application approvers and support team been transferred to the appropriate group?</h2>
  <button id="yes_button" class="btn btn-danger" onclick="yes_button();">Yes</button>
  <button id="no_button" class="btn btn-secondary" onclick="no_button();">No</button>
</div>
</j:jelly>
 
Please help on create client script
 

 

 

 

 

 

 

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Brahmi Pandla 

You said you want this UI page to open on click of Approve then why client script?

Are you referring to OOB Approve UI action on sysapproval_approver table?

if yes then why to customize that?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

client script required to change the state to approved when click on YES

and i need this dialog box for specific catalog item

 

 

@Brahmi Pandla 

you can use onChange client script and display business rule

Display business rule - will tell you the approval is for which catalog item and store that in scratchpad

OnChange - use that scratchpad and check the state is Approve then use GlideDialogWindow to show the UI page

refer below links for help

Display Business Rule and g_scratchpad 

GlideDialogWindow: Advanced Popups Using UI Pages 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Brahmi Pandla 

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader