How to link the same DETAIL forms multiple times to same MASTER form?

Good day,

I want to link the same form multiple times as a DETAIL form on the same MASTER form.

The problem that I have is that each DETAIL form should have its own “WHERE” clause in SQL.

So linking the DETAIL form 3 times:

  1. link to detail_form (WHERE category = [v_cat]) (in this case supplied [v_cat] = 1)
  2. link to detail_form (WHERE category = [v_cat]) (in this case supplied [v_cat] = 2)
  3. link to detail_form (WHERE categoty = [v_cat]) (in this case supplied [v_cat] = 3)

When I do this, [v_cat] is always “3” - even for the first link.

It seems like SC takes whichever last value was assigned to [v_cat] and uses that instead of the value assigned at point of linking…

So my linking ends up with:

  1. detail_form (WHERE category = 3)
  2. detail_form (WHERE category = 3)
  3. detail_form (WHERE categoty = 3)

instead of :

  1. detail_form (WHERE category = 1)
  2. detail_form (WHERE category = 2)
  3. detail_form (WHERE categoty = 3)

[SIZE=16px]How do I link detail_form multiple times with unique linking value [v_cat]?[/SIZE]

The only solution I found so far was to copy detail_form as detail_form2 using [v_cat2] and detail_form3 using [v_cat3]

This is not ideal as I know have multiple forms to maintain.

Thanks

Did add some code in the master to change the global [v_cat] when clicking a record in the master form?

Hi,

No - [v_cat] is specified as a Fixed value Parameter at design time for each link to detail_form. Something like :

[ATTACH=JSON]{“data-align”:“none”,“data-size”:“full”,“title”:“2020-02-03 16 52 41.png”,“data-attachmentid”:90158}[/ATTACH]

There is no clicking of a record - the DETAIL FORMS gets generated as the MASTER FORM renders.

2020-02-03 16 52 41.png

any suggestions from anybody please?

Good Question… SC creates just ONE GLOBAL VARIABLE for your 3 forms. so when you change the value… the other forms change your WHERE.
Must exist an unique internal variable for each form or instance, and it must get the value. there should be global variables at the form level.

I would try create other variable global OUT type array, named FormNumber, this one get the form number (1, 2, 3) and the value for your categoty…
maybe will try use a random function for the name of the variable.

AFAIK is a real mess.
You can end up with variables overwrites even when the same grid is used as detail in two different master forms and those forms pass to the grid different values for the same variable.
I’ve come to the conclusion that when different apps concurrently open the same form app (e.g. in different menu tabs) and they pass different values to the same variable in the form, using hidden virtual fields in the form is the only way to reliably store those parameters while avoiding overwrites: virtual fields seems to be unique for each app instance.
With grids is not that easy, as grids could have no records, so I’m still looking for a reliable solution.