November 5, 201411 yr Thanks for checking this out!  Anyone know a real simple and straight forward way to script the creation of a Parent record along with the creation of a Child with a Grandchild? The biggest hurdle I need help with is this creation of a record set.  So when ran, script would create the flowing set:  ParentTable-Project  >  ChildTable-Assignment    >  Grandchild-Milestone  I have all the match fields set up. Script would be ran from a sorted Grandchild list layout. Project and Assignment data is shown in a sub summary part.  If interested, some files along with demo attached to help illustrate my problem.   THANKS for any help! project_create_demo.fmp12.zip
November 5, 201411 yr Hey Randy, Simple task here, you just need create the records in succession and relate them as you go along. Here's the script that you need to make:
November 6, 201411 yr Author Thanks GisMo! Figured it would look something like what you illustrated for me. Did not know if there was a different way, like forcing the creation through a relationship, or something. So, I build it out and is working fine. Now wondering what is the best way to build a found set of the Project just created? I'm running script from Milestone List Layout. In Browse Mode, displaying data from the related Project and Assignments with sub summery parts. Thanks again!
November 6, 201411 yr Author Now wondering what is the best way to build a found set of the Project just created? So [Perform Find] works with variables now!!! Last time I tried using a variable for the find criteria it literally searched data "$id_milestone". But now it seems to work! Searching for "3213" for example. I don't know if I did something wrong in the past, or this is NEW to FileMaker 13 So... I got the creation script to work and finish up by finding the new Milestone by setting variable $id_milestone and [performing find on __mp_milestone ($id_milestone)]
November 6, 201411 yr Great! I'm glad that worked for you. Also, perform find with variables is not new, but I'm glad you figured that out! I'm not sure that there's another way to create all the related child records other than the method I posted. Good luck!
November 6, 201411 yr Here is another method. Run the create script from the context of Layout #4 in form view with the script debugger on and youll see how the relationships populate the foreign keys
November 6, 201411 yr Author Hi Kris M, Not fully following you, do you mind elaborating a bit? Thanks for chiming in!
Create an account or sign in to comment