简体   繁体   English

如何根据列中的值禁用 oracle apex 中的链接

[英]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.因此,当雇主登录 oracle apex 时,他们可以转到此交互式报告。 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.如果描述不清楚,请告诉我,我会尝试更改它。

I've been meaning to write a blog post detailing a simple example, but it belongs in your SQL.我一直想写一篇详细介绍一个简单示例的博客文章,但它属于您的 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 .或查看幻灯片 58

If I am understanding it correctly, you want to create a link in emp_Review column.如果我理解正确,您想在 emp_Review 列中创建一个链接。 When Emp_review column having value 'Not Applicable' then display link and open a form otherwise link should be disabled.当 Emp_review 列的值为“不适用”时,则显示链接并打开表单,否则应禁用链接。

You can achieve this in your Interactive Report SQL query only.您只能在 Interactive Report SQL 查询中实现这一点。 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:您可以编写以下代码,假设表单页码为 2,并且在第 2 页中创建了一个 P2_EMP_Id 隐藏项以将 emp_id 从第 1 页传递到第 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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM