Custom Web Publishing Guide

Table Of Contents
88 FileMaker Server Advanced Custom Web Publishing Guide
Adding records to a portal
To add a new record to a portal at the same time you add a parent record, use the –new query command and
do the following in query string for the request:
1 Use the fully qualified field name for the related portal field.
1 Specify 0 as the record ID after the name of the related portal field.
1 Specify at least one of the fields for the parent record before specifying the related portal field.
1 Specify the data for the match field (key field) in the parent record.
For example, the following URL adds a new parent Employee record for John Doe, and a new related record
for Jane in the portal at the same time. The name of the related table is Dependents, and the name of the
related field in the portal is Names. The match field, ID, stores an employee ID number.
http://192.168.123.101/fmi/xml/fmresultset.xml?–db=employees&–lay=family&FirstName=John&LastName=Doe
&ID=9756&Dependents::Names.0=Jane&–new
Note You can only add one related record to a portal per request.
Editing records in a portal
To edit one or more records in a portal, use the –edit command and a record ID to specify the parent record
that contains the portal records you want to edit. Specify the particular portal record to edit by using its
record ID in a fully qualified field name. You can determine a record ID from the record ID attribute of the
<record> element in the <relatedset> element in the XML data. See “Using the fmresultset grammar” on
page 29.
For example, the following URL edits a record in a portal where the parent record has the record ID of 1001.
Dependents is the name of the related table, Names is the name of the related field in the portal, and the 2
in Names.2 is the record ID of a portal record.
http://192.168.123.101/fmi/xml/fmresultset.xml?–db=employees&–lay=family&–recid=1001
&Dependents::Names.2=Kevin&–edit
Here is an example of how to use one request to edit multiple portal records via the parent record:
http://192.168.123.101/fmi/xml/fmresultset.xml?–db=employees&–lay=family&–recid=1001
&Dependents::Names.2=Kevin&Dependents::Names.5=Susan&–edit
You can also use the –edit command and specify 0 as the portal record ID to add a new related record in the
portal for an existing parent record. For example:
http://192.168.123.101/fmi/xml/fmresultset.xml?–db=employees&–lay=family&–recid=1001
&Dependents::Names.0=Timothy&–edit
About the syntax for specifying a global field
The syntax for specifying a global field is:
table-name::field-name(repetition-number).global
where global identifies a field as using global storage. For information about table-name and field-
name(repetition-number)
, see About the syntax for a fully qualified field name” on page 87. For information
on global fields, see FileMaker Pro Help.