Dr. Evil Posted November 5, 2014 Posted November 5, 2014 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
GisMo Posted November 5, 2014 Posted November 5, 2014 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:
Dr. Evil Posted November 6, 2014 Author Posted November 6, 2014 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!
Dr. Evil Posted November 6, 2014 Author Posted November 6, 2014 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)]
GisMo Posted November 6, 2014 Posted November 6, 2014 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!
Kris M Posted November 6, 2014 Posted November 6, 2014 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
Dr. Evil Posted November 6, 2014 Author Posted November 6, 2014 Hi Kris M, Not fully following you, do you mind elaborating a bit? Thanks for chiming in!
Recommended Posts
This topic is 4061 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now