A READER ASKS: Last FileMaker Portal Row Isn’t A New One

From Dwayne Wright PMP, PMI-ACP, CSM
Certified FileMaker Developer

WEB: www.dwaynewright.com
EMAIL: info@dwaynewright.com
TWITTER: dwaynewright
YOUTUBE: FileMakerThoughts

A READER ASKS
In my own solution I set up the relation between two tables without allowing the creation of records in the child table. Via a script I make a new record. The problem I encounter is that the script step 'Go to portal row - last' selects the last row, but I want it to select a new row where I can fill in the new data.

I hope you understand my problem and perhaps you can give me a clue to solve it.


DWAYNE RESPONDS
You cannot create new records via a portal without having the “allow the creation of new records” option active in the relationship. So if you create a new record via a script, you will need to make sure the related record has the primary key data. So the script will likely ...

- put the parent records primary key field data into a variable
- go to the related table layout and create the new record
- set the foreign key data using the variable / commit the record
- go back to the parent table (possibly refresh the screen)
- go to the last portal row and the appropriate field for data entry
- enter in the new data

NOTE: If the relationship or the portal has sorting in place, the target row may not be the last portal. Chances are that it is either the first row or the last one. You will want to make sure and perform a number of tests.

Now if the problem persists, here are some possible culprits ...

- the key id from the parent table isn't coming over properly
- the fields in the portal are not from the same relationship as the portal
- the fields behavior setting does not allow you to click into the field
- the fields security settings do not allow editing
- the foreign key field cannot accept new data (calculation field)
=
More info about the author and FileMaker in general, contact me at info@dwaynewright.com.

© 2009 - Dwayne Wright - dwaynewright.com

The material on this document is offered AS IS. There is NO REPRESENTATION OR WARRANTY, expressed or implied, nor does any other contributor to this document. WARRANTIES OF MERCHANT ABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Consequential and incidental damages are expressly excluded. FileMaker Pro is the registered trademark of FileMaker Inc.