Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Input object on launch form

Questions related to customising nuBuilder Forte with JavaScript or PHP.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Input object on launch form

Unread post 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
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Input object on launch form

Unread post 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?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Input object on launch form

Unread post 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
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Input object on launch form

Unread post by kev1n »

Why do you need to save the input dates/campaign into a table?
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Input object on launch form

Unread post 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 :-(
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Input object on launch form

Unread post 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#'
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Input object on launch form

Unread post 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...
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Input object on launch form

Unread post 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
You do not have the required permissions to view the files attached to this post.
kev1n
nuBuilder Team
Posts: 4301
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 445 times
Contact:

Re: Input object on launch form

Unread post 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.
BDemeuse
Posts: 92
Joined: Mon Apr 12, 2021 3:09 pm
Has thanked: 1 time
Been thanked: 2 times

Re: Input object on launch form

Unread post 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
Post Reply