Form as master and grid as detail?

I use to separate subfolders for my images, and the result is that my pictures are not displayed more than a split second in a form, but are displayed normally in a grid.
So I need to make a master/detail with a grid as detail and form as a master.
When I try to add a detail grid, the third step “Foreign Key” is greyed out, and I am getting the message:

“The target application grid_public_tbl0_product_image has no parameters.
Parameter setting is required so the application will display only records that meet to a specific condition.
See here how to set parameters”

The link “See here how to set parameters” is not sending me anywhere.
The database is set up with PK in the Master table named product_id and the FK in the detail table is named product_id. Both are integers.
There is no problem to set up a master/detail with two forms but images are not displayed.
I would really appreciate a solution to this issue. Thank you!

Hi
you have to populate the grid adding a where clause and a global variable.
i.e. WHERE customer_code = ‘[myVar]’ in SQL section
and pass the value as parameter from master form.

An alternative is to define an extra filter in OnScriptInit
if (isset([myVar]) and !empty([myVar])) {
sc_select_where(add) = “WHERE customer_code = ‘[myvar]’”
}
in this mode you can use the grid itself with o without filter. Define [myVar] optional.

Thank you very much, my problem solved :slight_smile:
In the SQL setting in the Image grid I added: “WHERE product_id = [v_product_id]” to the SQL, so the new SQL looked like this:
SELECT
image_id,
product_id,
color_id,
color_code,
image_file_name,
image_po_file_name,
image_status_id,
image_web_status,
image_old_color,
image_created_date
FROM
“public”.tbl0_product_image
WHERE
product_id = [v_product_id]

Then I added the following in my Master/Detail link:

You are welcome! :slightly_smiling_face: