Forum Stats

  • 3,758,427 Users
  • 2,251,387 Discussions
  • 7,870,189 Comments

Discussions

Get Next Navigation Order in APEX

V Rickert
V Rickert Member Posts: 165
edited May 7, 2013 9:34AM in APEX Discussions
How do I change the navigation from record to record to use another index besides the primary key? Under "Get Next or Previous Primary Key Value', APEX lists Navigation Order and Secondary Navigation Order. Would I put my secondary index value here? I do not wish to use the primary key which, in my instance, is only a sequence number (SEQ_ID). I need to use the results of a narrower data set such a Invoice_Number. Any suggestions?
Tagged:

Best Answer

  • GarryLawton
    GarryLawton Member Posts: 217 Bronze Badge
    edited May 4, 2013 9:22AM Accepted Answer
    Hi,
    I think there is a misconception here. The primary key declared in the process "Get Next or Previous Primary Key Value" is just used to get the row (actually, it doesn't have to be a primary key, any unique will do). The actual navigation for "next" and "previous" uses the "Navigation Order" column. Therefore use your primary key to get the rows, set the Navigation Order to invoice_number and if the rows need filtering then use the "Optional WHERE clause". For instance, if you are have linked to the row from a report, then use the same WHERE clause as the report. Please note that a form component has no connection to a report's result set.

    Hope this helps.

    Regards, Garry

Answers

  • GarryLawton
    GarryLawton Member Posts: 217 Bronze Badge
    Hi,
    you can use any column for the Navigation Order. Only unique columns make sense though.

    Regards, Garry
  • V Rickert
    V Rickert Member Posts: 165
    Thanks! I am basically a newbie at APEX though I've written PL/SQL in more traditional environments. Having said that, I've looked at the set up of the navigational get-next, and get-prev page items and I am not sure where I would specify the 'key' values, as they are not 'Primary'. I am using two 'key' values for the base query of the application page. Would I populate those two values in the 'Primary' and 'Secondary' key columns? I also see Navigation Order and Secondary Navigation Order. Are these items such as ASC? I see no documentation on the use of these fields in 'Source: Get Next or Previous Primary Key Value' in Oracle.

    Actually I googled and found this interesting entry:

    2355560
  • GarryLawton
    GarryLawton Member Posts: 217 Bronze Badge
    Hi,
    are we talking about "next" and "previous record" on a form?

    Regards, Garry
  • V Rickert
    V Rickert Member Posts: 165
    Yes! I guess I wasn't too clear! :)
  • GarryLawton
    GarryLawton Member Posts: 217 Bronze Badge
    edited May 3, 2013 2:58PM
    Hi,
    well, if it is a form and you are not using a primary key, how are you fetching and processing the row in the form? Are you using the ROWID?

    Regards, Garry
  • V Rickert
    V Rickert Member Posts: 165
    I use a primary key but it is a sequence number generated by Oracle. I do not want to use this key to navigate with. And, I do not use the ROWID provided by APEX. I want to navigate on a field that has a unique index such as an invoice_number or purchase order number. So, in other words, I need to navigate based on a filtered result set. Using the primary key (sequence_id) will give me ALL records. I need only the filtered set of data that is appropriate for the function of the form I am using.
  • GarryLawton
    GarryLawton Member Posts: 217 Bronze Badge
    edited May 4, 2013 9:22AM Accepted Answer
    Hi,
    I think there is a misconception here. The primary key declared in the process "Get Next or Previous Primary Key Value" is just used to get the row (actually, it doesn't have to be a primary key, any unique will do). The actual navigation for "next" and "previous" uses the "Navigation Order" column. Therefore use your primary key to get the rows, set the Navigation Order to invoice_number and if the rows need filtering then use the "Optional WHERE clause". For instance, if you are have linked to the row from a report, then use the same WHERE clause as the report. Please note that a form component has no connection to a report's result set.

    Hope this helps.

    Regards, Garry
  • V Rickert
    V Rickert Member Posts: 165
    OK! Thanks, I will try that! I won't get back to this post for a couple of days however. Other items on these same pages are needing my attention at the moment. I will get back with my results soon!
    Thanks so much!!! :)
This discussion has been closed.