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

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

Recommended Posts

  • Newbies
Posted

Hello,

I'm trying to figure out how to load a related database with default data each time a parent record is created.

To be more specific, I have two related databases, "Projects" and "Tasks". Each time a new Project record is created I want to populate the Tasks database with a number of default tasks.

I've been considering a couple approaches however I'm not quite sure how to implement. I'm assuming I need 3rd database which will serve as the source from which the default tasks will be copied...:

I'm a FileMaker newbie and would appreciate if someone could point me in the right direction.

Thanks!

Posted

you should script the creation of new records in both the Project & Task databases. If you have a portal, just issue a go last portal row, enter some data, go to last portal row until all defaults are in the child database.Since you can't do a lookup for multiple child records at a time, it must be scripted.

  • Newbies
Posted

Christian, thanks for the information. I do have a portal. So, is there a way to read each default record from a third file and add it to the portal as you suggest or are you suggesting the default data is scripted as well?

- hurl

  • Newbies
Posted

just had a thought... will this approach work?

Given Projects and Tasks are two databases related by their common "Project ID" fields.

1. Create button in the Project database called "Create tasks"

2. The script will set a global variable in the tasks database to the current project ID.

3. The script will import all records from a third file "default tasks". Each of the imported records will have a project ID = 0

4. The script will find/replace all Tasks with Project ID=0 to the value of the global variable which was set in step 2 above.

That seems like it should work.... any thoughts?

Posted

Why not do

Go to field [portal::task_ID]

Go to portal row, last -- the empty one

insert calc. result, task_ID,"wahever"

insert calc.result, task_name,"Project start"

and so on.

this will save a third file. Project_ID is entered automatically, because it defines the portal. makes sense if you have no more than 5 default tasks.

Otherwise, using above import example:

If you set field project_ID to auto-enter g_Project_ID and check "perform auto-enter...", you save step 4.

  • Newbies
Posted

I have quite a few default tasks for each project plus I want to retain the ability easily modify the default list so I went with the import approach.

Thanks for the help!

Posted

I've done this in the past with a template file that contains the default records. I just do an import from the template file into the child file and then set the key field in the resulting found set so that they relate to the parent record.

This topic is 7861 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.