Hi guys, new to Apex here! So far so good, but I found trouble on finding out the right way to implement stuff.
I have a page to show a record's values, followed by a "Cancel Request" button at the bottom of the page. I would like to implement this use case:
- When the "Cancel Request" button is clicked, I want to show a standard confirmation box - asking "Are you sure bla-bla" with Yes and No options.
- If Yes, I want to perform 2 actions: first is updating the record in the DB (simply setting the "Status" column of the record to CANCELLED), and second is redirecting to another page in the application.
How should I implement each step and actions appropriately? I read the documentations and discussions, but there are so many options to choose such as putting Dynamic Actions on the button, or Process, or JavaScript in the Header of the page. Can someone guide me to the best practice to implement these? Thanks!
P.S. I am using APEX 5 with theme Vita.
Danny
UPDATE:
Pmon provided a good approach. Just a little bit addition from me at the bottom of this thread ("Marked as Helpful") to make the Update SQL executed after clicking OK on the confirmation box.