I have a table PRODUCTS
which keeps all the product data. And I have a table ORDER_ITEMS
which keeps all the order items data. ORDER_ITEMS
has a column PRODUCT_ID
which is a foreign key to PRODUCTS
table referencing PRODUCT_ID
.
I've created a MASTER DETAIL REPORT
page on Apex which shows the ORDER_ITEMS
table report.
Right now it's showing PRODUCT_ID
. I need the PRODUCT_ID
column to show PRODUCT_NAME
MASTER DETAIL REPORT PAGE DESIGNER
I've tried changing the Source
Type
to SQL Expression
and tried running below but I'm getting an error.
select PRODUCT_NAME from PRODUCTS
where PRODUCT_ID = PRODUCT_ID
ERROR: Ajax call returned server error ORA-01427: single-row subquery returns more than one row for ajax_dispatch_request.
-------UPDATE-------
Based on Koen's answer, option 1, I've tried the below query but I am still getting the same error.
SELECT PRODUCTS.PRODUCT_NAME
FROM PRODUCTS
INNER JOIN ORDER_ITEMS_LOCAL
ON ORDER_ITEMS_LOCAL.PRODUCT_ID = PRODUCTS.PRODUCT_ID
There are many solutions to this question, here are a couple of options:
Modify the source query (select "SQL Query" instead of "Table/View" in "Source Type") of the detail report. Join to the products table and add a the product_name column to the "SELECT" clause
Set the column type to select list and in the query set product_id as return value and product_name as display value. Not that in this case you have a select list
Set the column attributes "Settings > Based On" to "Display Value of List of Values". The List of values can be defined on the page or be a shared component. Now the column will just be text field.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.