Posted on May 23, 2018
Tony Tauro, Performance Architects
This blog post builds on the work done in two previous blogs – Chapter 1 and Chapter 2. You could go through those or just read this one for reference.
In the last chapter, we created an expenses report (quite easily), but it had too many codes in it (e.g., the cost center field shows 101 and 103). We would like those codes to be replaced by the names of the cost centers. But, first, we want a place to maintain those names.
As you would know if you looked at our schema from Chapter 1, the cost centers are in a table called
“app_cost_centers.” We will create an “Interactive Grid” on this table which will allow us to view and edit the contents of this table from a page in our application.
- Just as before, login to APEX, go to the “App Builder,” and select your application to open it (the “Expenses App” from the last two chapters). Then click on the “Create Page” button.
- On the “Create a Page” screen, click on “Form.”
- On the “Create Page” screen, click on “Editable Interactive Grid.”
- On the next screen, enter a name for your page called “Maintain Cost Centers”. We say “Maintain” because this single page will perform create, update and delete functions. You can change the page number or use the default value. Click on “Next.”
- On the next screen, we will again opt to “Create a new navigation menu entry”, enter value under “New Navigation Menu Entry” and then click on “Next.”
- Finally, we need to specify the source. The entries on this screen should be as below:
- Editing Enabled: Yes
- Source Type: Table
- Table/View Owner: Name of schema where your table is
- Table/View Name: app_cost_centers
- Primary Key Column: ROWID (you can use an actual column from your table, but the ROWID pseudocolumn ( https://docs.oracle.com/cd/B19306_01/server.102/b14200/pseudocolumns008.htm ) is a good option if you want to keep things simple, which we do for now)
- Select all columns
- Click on “Create.”
- This creates your app. As before, you can now run it by clicking on the “Run” button in the top right corner:
- Your “Maintain Cost Centers” page is ready to use.
- Just like with the previous report, this page has an “Actions” button and all the options under that. There are additional options under the “Row Actions” button:
Feel free to explore more. The main features to notice are that you can add rows, delete rows and modify existing rows on this page. But this application has a few faults too, which we will try to address in the next chapter; for example:
- We want to see the name of the logged in user on the page (who said our imaginary end-user needs to be rational?)
- The ID field should be entitled “Cost Center ID” and should be read-only
© Performance Architects, Inc. and Performance Architects Blog, 2006 - present. Unauthorized use and/or duplication of this material without express and written permission from this blog's author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to Performance Architects, Inc. and Performance Architects Blog with appropriate and specific direction to the original content.