Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3669 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

post-80154-0-01751600-1415218327_thumb.p

post-80154-0-48019100-1415218343_thumb.p

Posted

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:

 

 b0shZac.jpg

Posted

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! :)

Posted

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)]

Posted

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!

Posted

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

Posted

Hi Kris M,

 

Not fully following you, do you mind elaborating a bit?

Thanks for chiming in!

This topic is 3669 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.