Forums

How to pass database records between multipages

NickOg 01 Sep, 2017
Hi
I am having trouble passing data from a database read function through successive pages. Using Max's multi-page demo i have just added a database read function in the load event.
[attachment=58853_20170901234621_4cf600-png.png][/attachment]
That is the only change to the form (copy attached) apart from debug statements to try to watch the data flow. The data is read fine on the load page but is not passed to any succeeding pages.

What have I missed! 😲

Nick
GreyHead 02 Sep, 2017
Hi Nick,

Do you have the DB Read *before* the Multi Page action?

Bob
NickOg 02 Sep, 2017
Hi Bob
No - should I? I will try that and see. Mind you - the multi form demo that Max left there doesn't have a multiform on the load page. I shall go play some more.
Thanks

Nick
GreyHead 03 Sep, 2017
Hi Nick,

The actions are executed in order so the data that is available at that point in the process is saved to the user session.. If the DB Read hasn't run then the data won't be available.

What exactly do you need to do here? Do you need the DB Read in the On Load event if you are going to pass the data forward?

Bob
NickOg 03 Sep, 2017
Hi Bob

Time to concentrate on this again today and check out your points more thoroughly.

To explain what I am trying to do:
We have a table of receipts that include amongst other stuff the date paid, who received the payment & how payment was paid. My form then has three pages
page 1. Choose the date range
page 2. Read the data in that date range (that works fine of course) and allow selection of who received payment and how payment was made.
page 3. Report the data for the selected date range, receiver and payment method. The trouble is that the data doesn't get passed down into this page.
Then
repeat reports with different receivers or pay via page 2 or
select a new date range via page 1

I am pretty sure that I can simplify that but I was using Maxs' demo to learn the ropes as it were! anyway - now to try out your suggestions.

Nick
NickOg 03 Sep, 2017
OK - checked using Max demo and setup as attached. Date is visible on load but not further down the chain.

Nick
NickOg 05 Sep, 2017
Sorted! Thanks to post by omidhz.

I used the save to session control providing a unique name or names (eg responseSessionName) and then read it into the next event using php so
and
$this->data'[response']= \GApp::session()->get("responseSessionName");


Thanks for that.

Nick
This topic is locked and no more replies can be posted.