Adding Pop-up message along with Buttons in UI action

Rajesh Bandila
Tera Contributor

Hi Everyone,

 

I have an UI action called “Request Document” button. When I click on UI action I would like a popup message to appear that says "Are you sure you want to send this Request Document."

 

In the popup window, there should be two buttons. “Proceed” and “Cancel”. Clicking on the “Proceed” button will launch process by sending the Request document. Clicking on the “Cancel” button will take back to the current page.

 

Please help me how to achieve this?

Thanks!!

1 ACCEPTED SOLUTION

@Rajesh Bandila : Below is the sample code that will help you. Enable client checkbox on UI Action and provide an action name and Onclick function name. 

 

sainathnekkanti_0-1703012114927.png

function requestDocument() {
    var answer = confirm("Are you sure you want to send this Request Document.");
    if (answer == true) {
        gsftSubmit(null, g_form.getFormElement(), 'action_name');
    } else {
        return false;
    }
}

if (typeof window == 'undefined') {
    // Add your existing server side logic here
}

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
 
Regards,
Sainath N

 

 

View solution in original post

9 REPLIES 9

Hi @Rajesh Bandila ,

 

This cannot be done as we are using some OOTB functionality of Java script. We cannot rename it to proceed.

 

Thanks,

Danish

 

@Rajesh Bandila : Glad that my code worked for you and to your question on relabelling, OK cannot be relabelled.

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

This works perfectly fine. I want this to be implemented for Service Operations workspace. How to achieve that ?

Hi @Rajesh Bandila ,

 

Plz provide snip for ur existing code so will modify it accordingly while converting it to client n provide u.

 

Thanks,

Danish

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Rajesh Bandila 

 

Hee you go:

 

https://www.servicenow.com/community/developer-forum/adding-ui-action-info-message/m-p/1895176

 

another hint

 

https://www.servicenow.com/community/developer-forum/add-an-alert-pop-up-message-to-the-ui-action-wh...

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************