creating related record by script

creating related record by script

am 27.01.2008 18:28:43 von pmanet

when you create a record in a portal, the good value for the linked
field is automatically filled.

How can you make this with a script, without a "set field" in the linked
field ?

--
www.D-L-S.org

Re: creating related record by script

am 27.01.2008 19:08:17 von Lynn Allen

On 2008-01-27 09:28:43 -0800, pmanet@invivo.edu (manet) said:

> How can you make this with a script, without a "set field" in the linked
> field ?

When you create a record through a relationship, ANY field can be the
Set Field and the relating data will be created in the key field in the
child file.

You still need to use Set Field, but you can set data into any field in
the child file.

You need to set the relationship definition to "allow creation of
related records" to do this.
--
Lynn Allen
--
www.semiotics.com
Member Filemaker Business Alliance
Long Beach, CA

Re: creating related record by script

am 28.01.2008 01:16:02 von Helpful Harry

In article <200801271828431028995@[10.0.1.1]>, pmanet@invivo.edu
(manet) wrote:

> when you create a record in a portal, the good value for the linked
> field is automatically filled.
>
> How can you make this with a script, without a "set field" in the linked
> field ?


If the Relationship is defined to "Allow creation of related records",
then the Portal can be used to make new records in the related table
.... either manually and via a Script (as long as the Portal is on the
currently displayed Layout of course).

Manually you just click on a field in the last row of the Portal, which
is always blank ready for a new record.

From a Script you can do the same thing - go to the last Portal row and
then add some data to one of the fields there.
ie.
Go To Portal Row [Last]
Set Field [Relationship::Field, "MyData"]

Just as when you manually create the new Portal row, the related record
will automatically be given the correct data in the link / key field.

Instead of using Set Field to add data to the new record, you could use
Go To Field instead and then have the Script end or pause for the user
to enter the new data. If the user doesn't enter anything in any of the
new row's fields (eg. just clicks outside the fields), then the new
record is not kept since there is no data for it.

Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)