[FX.php List] Creating header record and x sub-records from one Submit

Gjermund Gusland Thorsen ggt667 at gmail.com
Wed Oct 10 01:04:29 MDT 2007


Stuff the ID from the current master record in a $_SESSION -variable, such as
$_SESSION['currentMainRecordID'];

read up on this here: http://www.php.net/manual/en/ref.session.php

and use FMNew() for the sub records

ggt667

On 10/10/07, Tim 'Webko' Booth <tim at nicheit.com.au> wrote:
> Dear All,
>
> (And I'll probably kick myself when I get an answer but...)
>
> OK, for the sake of argument, I have to create one header record and
> then x sub-records in a related table...
>
> Creating the main record and grabbing the ID is easy, and I've got
> whatever info I need for each of the sub-records available.
> I can't use lookups based on IDs - not my choice, this system was
> originally FM only and scripted imports between tables, so I've got
> to carry the data across into the sub-records and insert it at the
> same time as I create them...
>
> What's the best way to go about creating the sub-records?
>
> Pseudo-code for the Submit page:
>
> Code:
>
> <form name="Create Request" action="request.php" method="post">
> Header Record Info
> <input type="hidden" name="requestedBy" value="Tim Booth by web">
> Purchase Order No: <input type="text" name="purchaseOrder">
> Notes: <input type="textarea" name="notes"></textarea>
>
> SubRecord 1
> <input type="checkbox" name="pickMe" checked value="R1741841">
> <input type="hidden" name="Account" value="BHP Steel">
>
> SubRecord 2
> <input type="checkbox" name="pickMe" checked value="R1743443">
> <input type="hidden" name="Account" value="BHP Steel">
>
> ...
>
> SubRecord n
> <input type="checkbox" name="pickMe" checked value="R1743447">
> <input type="hidden" name="Account" value="BHP Steel">
>
> <p align="right"><input type="submit" name="ak" value="Create Request"></p>
> </form>
>
>
> Thoughts?
>
> Cheers
>
> Webko
>
>
> --
> NicheIT Pty Ltd
> http://www.nicheit.com.au
>
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list