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!