Jump to content
Sign in to follow this  
SteveB

Exporting Child Records

Recommended Posts

I have a parent file and 2 child files. The user selects a found set in the parent file to export. How do I export the related child records into their own files? Will FM make the records in the child files the found set automatically when it creates the found set in the parent file?

Share this post


Link to post
Share on other sites

There could be two ways of doing this, depending on whether you want the *records* exported or just the *data*.

To export the records will be hardest, it may mean exporting the master records then using a looping script to go to the first exported master record, go to its related records and export them, then return to the master database and go to the second exported master record, go to its related records, export them... etc. A lot of work and a lot of export files to try to make sense of.

If you only want the related data, I'd suggest creating a calc field in the master database that uses the Design function to concatenate all the related record values. Depending on the export file delimiter, you may have to massage the calc field to create a menaingful string out of the related values.

I've done something like this before and it works well.

Share this post


Link to post
Share on other sites

I need the records, not the data. Besides, I'm doing a kiosk, and I've found that design functions that reference file names don't work after being run thru Developer Tool...the file references don't get changed.

Share this post


Link to post
Share on other sites

Then it's gonna be ugly then...

Unless you do it the other way... bring the related master information inot the related records (through calc fields) then just find and export the related records you want.

Yeah, that'll make it *much* simpler!

Share this post


Link to post
Share on other sites

It's pretty simple.

after creating found set in master file,gather all key fields in one global field (or by mean of creating an layout with only key field on it and performing script steps

Copy All Records

Paste [gField, select]

or by defining an conditional value list that use the key field )

Now create auxiliary relationships vs your children files from gfield-->rightKey and perform GTRR step with option show only related records followed by perform external script (the export script that you would have to define in every child file)

That's it

Dj

wink.gif

Share this post


Link to post
Share on other sites

Dj:

I'm confused about what you mean by:

Now create auxiliary relationships vs your children files from gfield-->rightKey and perform GTRR step with option show only related records followed by perform external script (the export script that you would have to define in every child file)

Steve

Share this post


Link to post
Share on other sites

I know I'm tired and sleepy this AM, but I don't understand the difference between exporting the data and exporting the records. Explain please??? confused.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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