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?
{!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); }
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
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);
}
If you want to write this code in VF, just make sure it should be inside Script tag
I am getting "
Error: Function REQUIRESCRIPT may not be used in this type of formula error"
can you give me complete code :)
Did you get a chance to go through it?
Regards
Gopal