0
votes

I would like to open a message box with OK-Button if a PL/SQL Function Body condition is true.

Furthermore, the message box should submit the page it was opened from when being closed.

I already tried several ways, with none of them bein successful. How can I achieve that?

I use Oracle Apex 5.1.

1
Can you just clarify how you want the flow to go? You want to click a button, run a pl/sql function and open a modal if the result is true, otherwise do nothing?RLOG
@RLOG: Exactly.Markus Appel

1 Answers

1
votes

Create a hidden page item, e.g. P1_ITEM with source null.
Create a button MY_BUTTON which submits page. Create a computation for P1_ITEM After Submit which runs your PL/SQL Function Body and returns 'Y' if the result is true.
Create a branch After Processing with server-side condition When Button Pressed = MY_BUTTON and Item = Value P1_ITEM, Value 'Y'.

This will only open the modal if your function evaluates to true (remember to clear the cache on page on redirect so that P1_ITEM is no longer = 'Y'.

For your second part, create a Dynamic Action of type Dialog Closed, Selection Type should be the region you click the button in, and Action Submit Page.

Edit based on Markus' comment: If dialog closed doesn't work (probably because the parent page is being submitted initially rather than redirecting), to submit the parent page you can set the button on the modal page to submit with an branch to the parent page.