function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
rajni bhagat 9rajni bhagat 9 

How do I show a popup message from a custom action(action is created on change console)( i want to show same popup message as we see in dalete )and if users presses the continue button execute a vf page and if user hits cancel go back to original page?

I want popup on resubmit for approval option
Gopal AgrawalGopal Agrawal
Hi Rajni,

Please give a try with below java script:

{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js')}
{!REQUIRESCRIPT('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js')}
try{
  jQuery(function() {
    /*Append the jQuery CSS CDN Link to the Head tag.*/
    jQuery('head').append('<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/start/jquery-ui.css" type="text/css" />');
    
    /*Create the HTML(DIV Tag) for the Dialog.*/
    var html = 
      '<div id="dialog" title="Go Home"><p>Do you want to go to Continue ?</p></div>';
    
    /*Check if the Dialog(DIV Tag) already exists if not then Append the same to the Body tag.*/
    if(!jQuery('[id=dialog]').size()){
      jQuery('body').append(html);
    }    

    /*Open the jQuery Dialog.*/ 
    jQuery( "#dialog" ).dialog({
      autoOpen: true,
      modal: true,
      show: {
        effect: "bounce",
        duration: 1000
      },
      hide: {
        effect: "bounce",
        duration: 1000
      },
      buttons: {
        "Continue": function() {
          location.replace('/apex/<vfpagename>');
          jQuery( this ).dialog( "close" );
        },
        Cancel: function() {
          jQuery( this ).dialog( "close" );
        }
      }
    });
  }); 
}
catch(e){
alert('An Error has Occured. Error: ' + e);
}
rajni bhagat 9rajni bhagat 9
Hi Gopal Can i type this code in VF Console
 
Gopal AgrawalGopal Agrawal
Yes 
Gopal AgrawalGopal Agrawal
Hey,

If you want to write this code in VF, just make sure it should be inside Script tag

 
rajni bhagat 9rajni bhagat 9
HI Gopal,

I am getting "
Error: Function REQUIRESCRIPT may not be used in this type of formula error"

can you give me complete code :)
 
Gopal AgrawalGopal Agrawal
<apex:page controller="jQueryUIBlockDemo_Con">
  <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
			<script> var jqNew = jQuery.noConflict();</script> 
			<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script> 
<Script>
//Include remaining code here
</script>
Please include script like this


 
Gopal AgrawalGopal Agrawal
Hi Rajni,

Did you get a chance to go through it?

Regards 

Gopal
rajni bhagat 9rajni bhagat 9
No it wont work..we can't only show the popup on action it can nly done throught Vf page .it is showing popup and visulforce as well .but we only wont pop up. soreplace this action with button ..thanks for your help