Sam Turner
Sam Turner

Reputation: 71

How to disable a link in oracle apex depending on what the value in a column is

I have an interactive report with many columns. One of these columns is employee review. In review the values can be good, bad or not applicable. This column has a link to a form which allows employers to change the review from not applicable to either good or bad. Another column is employees. This employees column has a link to the employee profile. So when an employer logs into oracle apex they can go to this interactive report. Right now i have it set up so that employers can click on the employee name column and go the employee profile and see their details. I want to make it so that once the review is set to good or bad, the link stops working (so that employers can only see employee profiles when they are reviewing them not at any other time).

Im not sure whether this would be a process or validation. I dont think its a dynamic action because it wont let me make a dynamic action based on a column in an interactive report. If possible could someone outline the code i would need to enter in the process to achieve this.

Please let me know if the description is unclear and i will try to change it.

Upvotes: 1

Views: 2333

Answers (2)

Parul J
Parul J

Reputation: 59

If I am understanding it correctly, you want to create a link in emp_Review column. When Emp_review column having value 'Not Applicable' then display link and open a form otherwise link should be disabled.

You can achieve this in your Interactive Report SQL query only. You can write below code, assuming the form page number is 2 and having a P2_EMP_Id hidden item created in page 2 to pass the emp_id from page 1 to page 2:

Select EMP_ID, --Or whatever ID column you have 
CASE when Emp_review ='Not Applicable' then 
'<A HREF=F?P=&APP_ID.:2:&SESSION.::NO:RP,2:P2_EMP_ID:'||EMP_ID||'></A>'
ELSE Emp_review
END Emp_review, 
other_column1, --Select other necessary column
Other_column2 
from --your table name

Upvotes: 0

Scott
Scott

Reputation: 5035

I've been meaning to write a blog post detailing a simple example, but it belongs in your SQL.

select case when col = 'reason to display' then
  apex_page.get_url(...)
end as my_col

And define column to not escape special characters.

Or check out slide 58.

Upvotes: 1

Related Questions