As a part of the button’s properties, an execution of “Automatic Row Processing (DML)” process either INSERT, UPDATE or DELETE (assuming those operations are allowed) can be controlled by selecting an appropriate Database Action as shown below.
APEX provides a way. The DML process will execute a requested database’s action based on the request value containing one of the listed values here –
By default, the request value of a button is the button name itself. But for onSubmit function, the request value is what in the passing value. For example, onSubmit(‘SAVE’) or onSubmit(‘APPLY CHANGES’) will execute database’s UPDATE operation.
The one I found the most useful is APPLY%CHANGES%. The wildcard allows the request value to be flexible.
I could use doSubmit(‘APPLY_CHANGES_D1’) and doSubmit(‘APPLY_CHANGES_U1’) to cause the update operation of all items of the current page. At the same time, it allows me to perform other different operations based on request values from using conditional processing.
The application I’m working on has two created-on-the-fly buttons in the “Display Only” item. The VIEW FILE link and Delete button are visible when file is stored in table. If not, only Upload button is visible.
When either button is clicked, all item information on the form will be saved (through DML’s update process). If Upload button is pressed, then page will be re-directed to the upload page. If Delete button is pressed, after confirmation, it will remove the actual file which is stored in a different table.