Adding an Edit Column in APEX

I’ve been working on an application that utilizes a selector on one of my pages. Currently it has 5 tabs – 2 that are based on tables and are available for edit, 2 that contain virtual columns based on table data and one that is based on a view. While creating one of my tabs, I ran into an issue where I wanted to update a row…but there wasn’t an option to do so with the page constraints (and, granted, I’m a newbie so there could definitely be a better way!). So I sought to figure out how to add an option to edit a row of data that was based on one of my tables and I got it! …After quite a bit of frustration and time. Hopefully this blog will help you get to the finish line quicker than I did.

  1. Add the new sub-region to the Selector region of the page. Right-click on “Selector” and click “Create Sub Region”.

    1

  2. I want to use a Tabular Form, so that’s what I chose from the drop down list. Give the region a name and SQL to pull data from noting that the first column selected is -> ‘ ‘ edit_link

    2

    3

  3. Under my new sub-region’s columns, click on “EDIT_LINK”

    4

  4. Under Identification, choose “Link” as the Type.

    5

  5. Under “Link” -> “Target”, click on “No Link Defined”

    6

  6. This will show the “Link Builder – Target” window

    7

  7. Under “Type”, choose “Page in this application” which is the page you are using to create and/or update rows.
  8. Choose the page you want to link to.

    8

  9. Now this next section is key to setting up your data to be prepopulated on your linked form. This is where you are going to link together the columns between what is shown on this report versus what is on the page you are linking to. If I demo first with ID, I will choose “ID” from the current page’s list of options.

    9
    Next, I will choose “ID” from the target page’s set of columns.

    10
    The screen will show the links between my two pages. I’ll continue doing this until all items are linked together.

    11
    12

  10. Click OK and you are done with linking the columns.

    13

  11. Next, you’ll need either text or an icon to show that a row can be edited. I, personally, like the standard pencil. Click the list next to “Link Text” and choose “apex-edit-pencil.png”. The slot will populate with some code that will show a picture upon running of the form.

    14

  12. You are done! If you run the page, you will see that the edit icon now shows.

    15

  13. If you click one of the rows, you will be taken to the form where it will be prepopulate with data and the “Update” button will show recognizing that it’s not a new record.

    16

  14. **Note that I also linked in my primary and foreign keys to make updating possible from this form even though they can’t been seen on the form itself.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s