Exception/Message handling from a plsql process in Apex
Hi All,
This question has many references and many links - but I am looking for a standard process for this.
I have a situation where I want to display alerts/messages based on a plsql process when a button is clicked.
I have done it in ways like :
Way 1 :
htp.p('<script type="text/javascript">');
htp.p('var r=confirm("All sections completed - Do you want to proceed?");
if (r==true)
{
alert("Complete");
completeAudit();
}
else
{
alert("Cancelled");
}
');
htp.p('</script>');
Way 2:
Raised the messages in an exception :
owa_util.redirect_url( 'f?p='||:APP_ID||':10:'||:APP_SESSION );
apex_application.g_unrecoverable_error := true;
htp.p('<script>alert("Unable to verify record creation in Glovia.Please contact support to locate the error:'||gn_error_log_id||'"</script>');
The issue is - at certain places - 1 works and at other places 2 works and sometimes neither of them work.
I am unable to understand the functioning - and have spent loads of time to standardize the message handling from a plsql process.
Any suggestions that would make me understand the process is much appreciated.
Cheers,
Jas