Help Creating Nested Grids

Hi,

I’m trying to create a tree view of nested grids. There will be 4 levels down from the main table like a cascading effect using the + button to expand. I’ve read the explanation of Nested Grids in the Help/User Manual, and the first issue I have is how to create the necessary parameters.

Here is what the manual says: (To use a grid as a nested grid is required that the nested application uses at least
one parameter or global variable in its SQL statement as on the picture bellow.).

When I try to create the link and select from the Applications List, SC never gives me the screens/options to set up parameters. It simply defaults to Create Without Parameters.

I don’t see how to define and set the parameters. What I have is an ID field on the main table(s) that will match the same field in the subsidiary table(s) so basically would be master_id in master table = master_id in subsidiary table as you would have in a where clause. Except, it seems like maybe a global variable needs already to be established.

I can’t figure out how to establish the global variable or the parameter such that I can use in the Nested Grid.

Could someone provide the steps necessary?

Thanks greatly,

Lyle

I would start with a small sample. If you have application A and need a nested grid with B then go to B, select sql section and put a where clause in using a global variable. I.e.

WHERE MyKey = [glob_key]

Then go to A and create your nested grid. You will be able to assign one of your variable to glob_key.

Hi Albert,

I tried the following where in your example, my application by is a grid of table t3 where I want records that match table a (t1) where the fields class_id in each match. So I tried a few iterations of the Where clause in grid b like the following (first without braces, then with braces, then with brackets. But SC doesn’t like my syntax so I don’t know what the correct expression is.

Appreciate your help on this.

Lyle

SELECT
class-id,
id,
category
FROM
mysqlt3
WHERE {class_id} = [glob_t1_class_id]

Whoops, I meant my application b, not by.

why not

SELECT
class-id,
id,
category
FROM
mysqlt3
WHERE class_id = ‘[glob_t1_class_id]’

Hi Albert,

You know when the code runs in the entry mode and you are prompted for the variable, then I get the following error:

Error
Error while accessing the database:
Unknown column ‘class_id’ in ‘where clause’
select count(*) from mysqlt3 where class_id = ‘1’

Hi Albert,

Okay, that part works, it was my fault, I had a hyphen where should have been underscore. I need a) a bigger screen or b) glasses!!

I’ll go on to the second stage in a bit.

Thanks greatly,

Lyle

Thanks greatly Albert. Got it all working with other grids too now based on your info.

Best,

Lyle