"Multi-users" usage could potentially allow one user to overwrite what another user chooses.
APEX Design Note
Once you start a Process, it must complete completely or it must fail completely. There is no method for "interaction" once you start a Process.
Follow these steps
- Use a Dynamic Action to see if "data is there or not" (do not do DML)
- pop up a message/ask question based on results
- save result in a HIDDEN ITEM (or set the Action)
- Auto submit page to Process the data.
Hi mike, thanks for your help, I think it is correct and I will try it.
Fabrizio Delli Priscoli wrote:
I'm on APEX 18.2 and here is my scenario.
I have 3 items, "year", "month" and button "find data"; user enter year and month and then press button to find records for year and month he has inserted submitting the page.
I have a process that make a select from the table for that year and that month and if there are no records this process provides to insert record in the table and display them in an intercative report.
If there are records in the table I want to display a confirmation message to the user asking if he wants to delete actual records in the table or not.
If user press "delete and reinsert" option of my confirmation message, process must first delete the actual records for year/month and then reinsert them.
If user press "don't delete" option, process must only display the actual records.
So how can I display the confirmation message inside the process, that is type PL/SQL code ?
You can't. APEX is not Oracle Forms. That is not how APEX (and web applications in general) actually work. Here is a simplified model:
Browser Request page Server Page show processing Browser Rendering Initialization User interaction Submit page Server
Page accept processing
On completion of page accept processing, APEX starts the cycle again by branching to perform page show processing for the same or another page. User interaction with the application can only occur in the browser after the page is rendered and event handlers required by APEX components and dynamic actions have been initialized. There is no way for the user to interrupt or interact with page accept processing after the page is submitted.
Any requirement for users to react to partially processed data must be designed into the application, typically by using separate pages to create multi-stage wizards, with intermediate results being stored in APEX collections.
Hi all, I have resolved in this way.
Under button "find data" I have 2 dynamic actions.
One check if data are stored in table... to achieve this under "Server-side Condition" property I have set "type" with "No Rows Selected" and in the SQL query box I have put the query to check.
Then under true node I have put a submit page and I have a process that provide to insert record directly without providing a delete action.
The other dynamic action is similar to the previous one and checks if there are records on table... to achieve this under "Server-side Condition" property I have set "type" with "Rows returned" and in the SQL query box I have put the query to check if there are records.
In this process first i make a delete action to delete records for year-month and then I make the insert statement.
Hope that this can help someone.