Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Understanding Button path ways in APEX

Posted on 2012-08-10
Medium Priority
Last Modified: 2016-10-20
Hi All,

When a page is submitted in APEX, can you describe any way of making the record update conditional on  a Yes/No confirmation box, with the opposite choice running a custom SQL statement:
 1. user clicks Save
 2. prompt user to confirm save
      a. if saved then, update record as per standard Automatic Row Processing (DML)
      b. if not saved then, "UPDATE ACTIVITY_REQUESTS SET STATUS = :P14_STATUS"
(Alternative ways of achieving the same outcome gladly considered)

Additional Information
If you could help me out with a better understanding of buttons that would be great.  These four questions give expression to one 'hole' in my understanding.

Q1) The help given under 'Database Action' in 'Edit Page Buttons' on an APEX form states - "If I do not set this attribute, database processing will execute based on the button name. The button name determines the value of he built-in attribute REQUEST." - what does this mean? can I specify a PL/SQL script somewhere?

Q2) I have created some Processes with ('On Submit - After Computations and Validations'). I have a working knowledge of these, but I don't understand how APEX knows when / which process to run when a button is clicked.

Q3) how do the tags 'DELETE' and 'SAVE' (i.e. see following example) tell APEX which processes / updates / deletions to run?

Q4) I have a funny bug in which I click delete, and the save action is processed.
      i) The Delete button 'Action' is 'Redirect to URL' =

Open in new window

this throws up the expected message box, but the record is never deleted - instead various processes run which are only meant to run when the record is saved.
     ii) the SAVE button Action is 'Defined by Dynamic Action' with '- No Database Action'.  The dynamic action either updates the field 'Status'  or saves the entire record using the following java command:

Open in new window

Question by:_Benaiah
  • 4
  • 2

Author Comment

ID: 38286085
The issue may include they way I've created my Dynamic action

Author Comment

ID: 38286150
How about specifying the process using an AJAX call? Can my Dynamic action make an AJAX call using java?
LVL 20

Expert Comment

ID: 38287921
I think some/all of your questions may be answered if you look at the attributes for a PL/SQL page process. In the Conditions section, you have the option of choosing When Button Pressed - where you can pick the button associated with the process. You can also fine tune your process with the Condition Type (in the same section), but neither one of these is required.

Basically, the process flow is as follows:
- the process runs according to the path set in the Process Point section (i.e., On Submit - After Computations And Validations/default)
- at this point, the options are evaluated according to the Conditions section. For example, if your condition type is set to Never, the process will not run.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


Author Comment

ID: 38290236
I have clarified some of my original queries now, but do not quite have a complete understanding of the way buttons work.  

1. I'm familiar with the 'When Button Pressed' condition on the process page, but I notice that if no button is specified the process still runs (if the page is submitted).

2. This seems to make sense given that the 'process point' I have specified is 'On Submit...'

3. In the Button attributes, the Action when clicked can be specified as 'Submit page' but as I have chosen 'Defined by Dynamic Action' the situation is complicated somewhat

4. In the True action on the Dynamic Action, my java script causes the page to be submitted using this line: apex.submit('SAVE'); But (assuming I do not specify a button name as per point 1) I could as easily have used this command to achieve the same result: apex.submit('XXX');

5. Whatever other ways the SAVE tag may be used, all I know is that it can be used as a condition on a page process

6. The Button template uses the information to construct the button:
<button value="#LABEL#" onclick="#JAVASCRIPT#" class="button-default" type="button" #BUTTON_ATTRIBUTES# id="#BUTTON_ID#">

Open in new window

7. Somewhere the button listener is created and the 'onclick' trigger inserted (whatever "void(0)" does).  How this works is still a black box to me. But I think that may be more a Web Development question rather than anything unique to APEX.

Author Comment

ID: 38290256
Thanks gatorvip again,

The remaining queries remaining would then be:
1. I have not specified a DELETE process.  Where can I find the 'Page Process' for:

Open in new window

I guess that the 'Database Action' > 'SQL DELETE action' is doing it, but what is being deleted?

2. are any of these tags (i.e. DELETE, SAVE, CANCEL) reserved words in APEX, meaning that functionality is hard-coded into any button using that Name?

and, please confirm
3. if am 'On Submit...' page process  does not specify a button, then any button on the page that submits the form will trigger the page process.
LVL 20

Accepted Solution

gatorvip earned 2000 total points
ID: 38291674
1. Among other features, APEX has predefined PL/SQL packages and JavaScript libraries. That's what allows it to call them without explicitly setting a path. In this instance, what you're asking is basically where you can find the JS function apex.confirm, as 'DELETE' is just the request being passed to the function.

Here is the official documentation (it's for 4.0, but 4.1 will be similar)

More specifically, the documentation for apex.confirm is here.

2. Yes and no, you will have to specify an additional database action of SQL Delete (if your button is DELETE). Often, you will need additional functionality that a simple APEX delete/save does not provide. That's when you use your own code, bypassing default APEX functions.

3. Correct. If you have no restrictions (and really, specifying a button is just a restriction), then the process will always run. The key here is that a button submits the page, while the process runs after Submit.

Expert Comment

by:Francis Osei
ID: 41852933
What to find out about deletebuttons

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question