Important Update: Community URLs redirect issues are partially resolved. Learn More. .

cancel
Showing results for 
Search instead for 
Did you mean: 

Pop up message on AWF button

MMHH2233
Contributor

I am working on the pop up message when a user selects an advanced workflow button.  For example if the user selects “Approved”, a pop up message : “Please confirm.” appeared and required user to click ‘OK’ or ‘Cancel’ button. If user selects ‘OK’, then it will flow to the next workflow automatically.

MMHH2233_1-1672191183524.png

I used select element to get the name of the AWF button and added it to the code (as below). The pop up message appeared when I select "Approved", but it won’t have any response after I select "Ok".

<script>

               var

                              title = 'Submission confirmation',

                              message = 'Please confirm';

              

               function saveApply(action) {

                              var userConfirmed = function(arg){

                                             if(arg) {

                                                            if(action == 'submit') {

                                                                           $("a:contains('Submit for Approval')").click();

                                                            } else if(action == 'approved') {

                                                                           $("a:contains('Approved')").click();

                                                            } else if(action == 'review') {

                                                                           $("a:contains('Submit for Risk Review')").click();

                                                            }

                                             }

                              }; 

                             

                              WarningConfirm(message, userConfirmed, title);                             

               }

              

               Sys.Application.add_load(function() {

                              $("a:contains('Submit for Approval')").unbind('click').prop("onclick", null).click(function(){ saveApply('submit'); return false;});

                              $("a:contains('Approved')").unbind('click').prop("onclick", null).click(function(){ saveApply('approved'); return false;});

                              $("a:contains('Submit for Risk Review')").unbind('click').prop("onclick", null).click(function(){ saveApply('review'); return false;});

               });

</script>

1 REPLY 1

Anonymous
Not applicable

@MMHH2233,

You are unbinding actions for your AWF buttons and then calling the same AWF buttons again after user confirmation. Also, I would not rely on just a:contains for selecting the button, but rather direct ID at least for testing purpose.