Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Javascript confirm message on a link in a classic(based on function) apex report

ShalFeb 27 2018 — edited Mar 1 2018

The aim here is to Close a Work Order by clicking on a link in a classic report which is based on PL/SQL Function Body returning SQL Query.  It works fine when I use Confirm message from Dynamic Actions but not when I want to display  javascript confirmation message

The following has been done:

1. Ask for user confirmation, by displaying a javascript:apex.confirm message instead of the dull Confirm message in Dynamic Actions.

2. When the user confirms the Closure, the link passes the id of the work order that needs to be closed as shown below:

<a onclick="return apex.confirm(''Are you sure, you want to close this work order?'');"  href="#" style="color:red" id="' || t1.wo_id|| '" class="CLOSE_WORK_ORDER fa fa-times-circle"></a>'  as CloseWO,

3. Then dynamic actions (based on the  on-click event with jQuery Selector Type)  is created to pass:

a) the selected id in a javascript

apex.item("P31_TEMP_SLTED_WO_ID").setValue(this.triggeringElement.id);

b)Execute the PL/SQL Code that will do the check and eventually Close the Work Order

c) Alert to show that the Order has been successfully closed.

Result: The javascript confirmation message displays ok, but it shows after the pl/sql code has been executed.

Can anyone shed some lights on what I'm doing wrong please?

Thanks!

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2018
Added on Feb 27 2018
14 comments
1,679 views