Jump to content

Creation of Related Records


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

Recommended Posts

I'm wondering what method folks are preferring for scripted creation of related child records in FM GO.  With Pro I would generally store the parent ID in a local variable, change layouts to a utility layout of the related table, create a new record, set the parent ID, set a other data as needed and then return to the original layout.  This seems ponderous in the GO environment.  How are folks doing this with GO.

Link to comment
Share on other sites

The subject here is FM GO.

 

Where there is  no such thing as an off-screen window.

 

I prefer the auto-create method using global fields. No need to change layouts.

  • Like 1
Link to comment
Share on other sites

That's a bit of a quibble, Bruce.

 

On FM Go creating a new window and then closing it won't show any intervening screen changes. Just iOS's default spinning circle until the script is complete. The benefit of a new window is the user doesn't lose their place. I use an "offscreen" window since I use the same script for Pro and Go.

 

Global creation is ok, but it takes some schema overhead: a global field, an additional TO, and a relationship for each table you want to create child records for.

Link to comment
Share on other sites

There's some schema overhead with creating related records without switching context, but switching layouts is a relatively slow way to create records, and opening new windows is even slower — both of which need an "escape hatch" mechanism if the user aborts the script before it's done with those contexts. Creating records transactionally without leaving the layout where the script started removes the need for the escape hatch, performs faster, and it's transactional so that the whole operation can be easily reverted in the event of an error. It's especially faster in the event of a FileMaker Go app connected over a network, since very little needs to be saved over the network until the transaction is committed.

Link to comment
Share on other sites

Looks like using globals is slower...if you take out the Commit[] inside the loop of the New Window method (or add a Commit[] to the global loop). This is being tested locally with 5000 per loop.

 

I suspect globals may be faster if you're only creating one or a few records. But then the difference wouldn't really be noticed anyway.

 

The transactional aspect is useful, but for single child record creation I'm not sure if it matters.

Link to comment
Share on other sites

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