You have probably noticed the fact that after you create a form on a table or a view or a form on a table with report, with the page create wizard, with the delete operation included, the Delete button's target is an URL with the following value:
depending on the Apex version you use.
From this point on we will consider the code for Apex versions after 4.0. The principle is valid for version before 4.0 as well but with confirmDelete instead of apex.confirm.
Therefore, when you push the Delete button, a window will pop up asking you to confirm that you really want to perform the delete operation.
The value is set to a pre-defined the predefined "DELETE_CONFIRM_MSG" value which is by default the text: Would you like to perform this delete action?
The routine definition is normally as follows:
Then, the process must be set to trigger not when the button is pressed, but when the request has the DATA_EXEC value. The Conditional Processing field of the Data Execution process must look like this:
The value of this P1_QST_TXT item has to be set in a Before/After Header/Regions/Footer process. This is a little tricky. Simply setting the value like this
:P1_QST_TXT :=' Are you sure you want to submit the data you entered?';
should work, you would think. Well it doesn't. The value of the P1_QST_TXT field must also contain the ' ' characters. Therefore the assignment has to be:
:P1_QST_TXT :=''' Are you sure you want to submit the data you entered?''';
:P1_QST_TXT :=''''||' Are you sure you want to submit the data you entered?'||'''';
And of course if you need the question to be dynamic, based on a certain criteria, then the value of the P1_QST_TXT item must be set to comply with your needs. Let's say that you need to have in the question text the name of the product that you submit the data for, and that this name is stored in a page item called P1_PRODUCT.
The assignment will become:
:P1_QST_TXT :=''' Are you sure you want to submit the data you entered for product '||:P1_PRODUCT||'?''';
And now pushing the Execute button for two different products, let's say printer and computer will look like this: