Tuesday 31 May 2016

Create Dynamic / Custom Menu Links

Create Dynamic Menu Links

Disclaimer: The views expressed on this blog are my own and do not necessarily reflect the views of Oracle

Recently, one of my APEX project had a requirement from the stakeholders that they wanted a dynamic menu to be available when a user clicks on a link in one of the page.

The easiest way to do that is using substitution variable and I will show you how it can be done.

1. Create the page where your link would be available. I had a page with a classic report containing some columns defined as links
2. Create the target page the above link refers to. In the target page, define a page item that will hold the value passed from the link in #1.

3. Now create the page to which the menu should point to. In this page, define another page item that would store the value passed from the menu and which you can use to filter your data.
4. Finally, create the menu link by going to the Application -> Shared Components -> Navigation Menu -> Desktop Navigation Menu. Click on "Create List Entry" and provide the following value (replace the relevant item references and page with your value).
Now when you run your application and you click on the link defined in #1, your menu will display the value contained in the page item. When you click on the menu, it will take you to the target page with the result filtered based on the value in the menu (in my case, navigate to Page 24 with P24_SAMPLE having value "T1234" as per example below)