Jump to content

How to create new child records using a script when the database is big


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

Recommended Posts

Posted (edited)

Hi,

For creating children records starting from the parent table, I use a script like:

Go to layout (target table for child records)

New record/request (new child record)

(Capture the child record ID)

(Do some other tasks)

Go to original layout

The problem is that the database is growing and going to the child table layout is not practical anymore because when it does, it shows all child records (several thousands) before creating the new record. I cannot use a Go to Related Record because there might be no related records. Scripting a Find before the going to the layout is not practical either (does not make any sense, anyway: what am I going to find?).

How can I script new child record creation and avoid showing all child records in the child layout? Take into account that all this is scripted, the user does not have any control over the process except pressing the New child record button from the parent table.

Thanks

Edited by Guest
Posted

Could you create the child records via the relationship from the parent layout?

If you create a relationship and select to allow creation through the relationship, then you can have a portal and create all the records. You could also just use the relationship to create the first child record and then GTRR and create the rest of the records.

Thoughts?

Posted

  Quote
Could you create the child records via the relationship from the parent layout?...

Hi, I do not allow users to create child records using a portal. Everything is scripted to have better control on what is going on, avoid user errors and have additional task performed during record creation.

Thanks

Posted

  Quote
Try starting your script with Freeze Window.

Thanks. That solved the display issue. But: would it not be faster for FileMaker to create the record in a child layout with no records at all, instead of having thousands of records and adding one new record at the end? Just wondering...

Posted

It will probably be even faster if you remove all the fields from the child layout.

Unstored calcs which are on display will slow things down.

Posted

I don't think so. Filemaker is a lazy application - it rarely does anything beyond what's required at the moment. If there's no window to render, then there's no need to figure out how many records are in the found set, or which ones of those are visible and need rendering, etc.

Posted

Change the layout to form rather than a list layout. If it's a list layout then FileMaker Pro must pull down all of the data for the records that are displayed in the window. With a form, it's only ever one record.

Posted

  Quote
Filemaker is a lazy application - it rarely does anything beyond what's required at the moment.

That's not lazy... that's highly optimised.

I should know, I'm highly optimised too!

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