FW: [FX.php List] Spawning a related record with FMNew
Steve Winter
steve at bluecrocodile.co.nz
Thu Oct 28 17:41:18 MDT 2004
Dennis,
If you're creating records on the 'many' side, then my initial thought is
you're going to need to run a three step process...if you put
$query -> ('Contact::key' = $_POST['contact']);
in your primary 'many' database creation then I suspect you'll get an
error as there will be no relationship at the time at which the record in
the 'many' db is created..
How I'd be inclined to tackle this would be;
step one, create the 'many' db record, setting the field in that db
which is used by the relationship
step two, search the 'one' database to see if that key exists
step three, if not, create that record
You can do this by putting three FX.php queries into your php page...
In fact it may be possible to avoid 'step two' as you could check in the
returned data from step one, to see if a field from the 'one' database has
data, if it does, then you know that the contact is there, if not, create
it with a second FX.php query to the 'one' database...
Not sure that this is the _best_ way to do this, but I think it would
work...hope it makes sense...
Cheers
Steve
> Hello,
>
> I have two FMP6 files with a simple relationship on a text key.
> The relationship is a 1->Many (1 Contact to many Interactions), and
> I'm working on the many side. We have a FM interface where the user can
> enter the date, the key, and a description of the interaction. If the
> key is not present in the Contact db then a new Contact record is
> spawned. I want to do something similar with the web interface.
>
> For an FX query, can I populate a related field like
> Contact::key to spawn a new record? Or do I need to form a separate
> query and make a new request on the other table manually?
>
> Thanks in advance,
>
> Dennis Crall
> ITS-Academic Technologies
> University of Iowa.
>
>
> _______________________________________________
> 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