Page 1 of 2

Input object on launch form

Posted: Thu Feb 03, 2022 6:16 pm
by BDemeuse
Hi,

I have a launch form with input values (used as selection criteria) that I need to run a browse form with the results of the selection (of data from a table).
However I do not know how to recover these input data (to store in a table), not linked to a table, to run the selection.
With a launch form, I have a "before edit" custom code (it seems to soon) and with the run/browse form, I have a "before browse" custom code... and it seems to late ... if I am not wrong!
In addition, I would like to run the result (iframe) in another tab.

Below, attached print screens and I hope the explanation is clear enough.

Thanks,

Regards,

Brigitte

Re: Input object on launch form

Posted: Thu Feb 03, 2022 6:43 pm
by kev1n
Does the process look like this?

1. Open the Launch form
2. Fill in "Dates Dons", "Campagne"
3. Selection Donateurs
4. Refresh iFrame "Liste Dons" using the selection criteria

At what point should the criteria be restored? When the form is opened again?

Re: Input object on launch form

Posted: Thu Feb 03, 2022 7:42 pm
by BDemeuse
Indeed, the list of dons (tr_don table) is used as input for the selection.
I need to apply the selection criteria (Dates Dons" and "Campagne") to extract the data (tr_dons) grouped by id's of the "donateurs".
I have a SP to execute this selection that I can call when the browse form "List Selection Donateurs", another table, not the tr_dons.

I do not know how to trigger (events ?) these 2 actions:
-) to save the input date ("Dates Dons" and "Campagne") into a table
-) call the SP to execute the selection

Re: Input object on launch form

Posted: Thu Feb 03, 2022 7:54 pm
by kev1n
Why do you need to save the input dates/campaign into a table?

Re: Input object on launch form

Posted: Thu Feb 03, 2022 8:21 pm
by BDemeuse
I would like to run a query to save the input object values in a table that will be used by the SP to select the "donateurs" from the tr_dons table... but I do not have any php "entry" to do it... maybe my design is wrong :-(

Re: Input object on launch form

Posted: Thu Feb 03, 2022 8:51 pm
by kev1n
Is my understanding correct?

1. Open the Launch form
2. Fill in "Dates Dons", "Campagne"
3. Run "Selection Donateurs"
4. Stored Procedure is called that uses the values from 2) + 3)
5. Result from SP is displayed in the iFrame "Liste Dons"

In the SQL, you can reference the input fields by using a Hash Cookie.

E.g.

Code: Select all

SELECT * FROM my_table WHERE my_date = '#cridn_date_debut#'

Re: Input object on launch form

Posted: Fri Feb 04, 2022 12:48 pm
by BDemeuse
It is correct except for the step 5.
The result of the display is another table that the one display on the form.
I would like to display on another tab, the "Selection Donateurs" tab
As it is a launch form (so not linked to a table), where can I run the query
-) to store the input object values in the DB
-) to call the SP

It seems I am on the wrong way...

Re: Input object on launch form

Posted: Fri Feb 04, 2022 4:20 pm
by BDemeuse
Hi Kevin,

I have tried to simplify my issues, refer attachements.
I have indeed 2 questions
1° how to get values (input object) of the "Selection Donateurs" form (launch form) to the "Liste Selection Donateurs" form (browse form) in order to execute the SP in the BB Custom Code
2° How to refresh after the run... it is a launch form iframe without button to click on

Do I need to use java script events ? How to pass info from an form to another ?

Thanks a lot

Bri

Re: Input object on launch form

Posted: Sat Feb 05, 2022 10:23 am
by kev1n
To refresh an iFrame, use nuFilterRun()
In your case, you can omit the 2nd parameter.

What does the sp return?

In BB (PHP), execute your sp, create a temporary table and insert the sp's result into it.

Re: Input object on launch form

Posted: Sat Feb 05, 2022 5:57 pm
by BDemeuse
Hi,

The SP creates a table with the selection
However, how can I get the 3 parameters (Date_Debut, Date_Fin, Campagne) because it is not the same form and there is no "save" button to set it.

Thanks again for your support!

Regards,

Brigitte