Using below code you can take a confirmation before execution even you can do conditional button press and execution.
apex.message.confirm(
"Would you like to submit for approval? Click OK to continue or Cancel to return to the page", function( okPressed ) {
if( okPressed ) {
if (apex.item("P23_ITEM").isEmpty()) {
apex.page.submit(
{
request: "CREATE" ,
showWait: true, } );
}
else {
apex.page.submit(
{
request: "SAVE" ,
showWait: true, } );
}
} else {
// this code will execute if cancel button pressed
apex.item("P23_ITEM2").setValue("N");
}
});
No comments:
Post a Comment