Databases Reference
In-Depth Information
Figure 13-9. Report called with filter set
If you need to navigate to different pages based upon the data or the role of the user, you can create
the link URL within your query and then include it as a column reference (e.g., #LINK# ). The snippet
below would produce a link taking users to page 2 for OPEN items and to page 3 for CLOSED items (clearing
the cache of the page and setting the application level item PREV PAGE to page 1 so that a Cancel button
and branches can return the user to the proper page.
select ID,
case when STATUS = 'OPEN'
then 'f?p=&APP ID.:2:&APP SESSION.:::2:PREV PAGE,P2 ID:1,'||ID
when STATUS = 'CLOSED'
then 'f?p=&APP ID.:3:&APP SESSION.:::3:PREV PAGE,P3 ID:1,'||ID
end LINK,
ITEM NAME
from …
Using this method, you can vary the URL but a link will always display.
Often, it is useful to include links for only certain records. That is handled by coding a full <a href…
into your SQL, as shown in Listing 13-5.
Listing 13-5. Adding a Dynamic Link
select PRODUCT ID,
PRODUCT NAME,
PRODUCT DESC,
CATEGORY ID,
(select CATEGORY NAME
from AB CATEGORIES C
where C.CATEGORY ID = P.CATEGORY ID) CATEGORY,
case when AVAILABLE YN = 'Y'
then 'Yes'
else 'No'
end AVAILABLE YN,
PRICE,
case when AVAILABLE YN = 'N'
then '<a href="f?p=&APP ID.:7:&APP SESSION.:MAKE AVAILABLE::7:P7 PRODUCT ID:' ||
P.PRODUCT ID ||'">Make Available</a>' end ACTION,
(select COUNT(*)
from AB PRODUCT REVIEWS R
Search WWH ::




Custom Search