Export all fields
am 26.10.2007 00:02:54 von Bill Steele
Trying to create a script to archive records. If you do this by hand,
he dialog allows you to choose "current table" or "current layout." But
the Export Records script step doesn't offer this choice, and you get an
export of only the fields in the layout. Best I can think of is to
create a new layout and put every field in it. Other suggestions?
Re: Export all fields
am 26.10.2007 01:39:59 von Helpful Harry
In article , Bill
Steele wrote:
> Trying to create a script to archive records. If you do this by hand,
> he dialog allows you to choose "current table" or "current layout." But
> the Export Records script step doesn't offer this choice, and you get an
> export of only the fields in the layout. Best I can think of is to
> create a new layout and put every field in it. Other suggestions?
You don't say what version of FileMaker. In the older versions you can
manually export some data, and then use the "Restore" option on the
Export script command to use that same order / fields (the export order
and fields are then stored with the script). Presumably this option
still exists in newer versions if only for compatibility reasons.
If you are archiving ALL records (rather than just a subset), then you
can simply Save As the entire file instead of exporting data.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
Re: Export all fields
am 26.10.2007 04:57:11 von unknown
On 2007-10-25 16:39:59 -0700, Helpful Harry
said:
> In article , Bill
> Steele wrote:
>
>> Trying to create a script to archive records. If you do this by hand,
>> he dialog allows you to choose "current table" or "current layout." But
>> the Export Records script step doesn't offer this choice, and you get an
>> export of only the fields in the layout. Best I can think of is to
>> create a new layout and put every field in it. Other suggestions?
>
> You don't say what version of FileMaker. In the older versions you can
> manually export some data, and then use the "Restore" option on the
> Export script command to use that same order / fields (the export order
> and fields are then stored with the script). Presumably this option
> still exists in newer versions if only for compatibility reasons.
>
> If you are archiving ALL records (rather than just a subset), then you
> can simply Save As the entire file instead of exporting data.
>
> Helpful Harry
> Hopefully helping harassed humans happily handle handiwork hardships ;o)
Seconding the file saving method. I've found all of my archives that
had zero errors were ones where I just duped the whole shebang and then
dumped the difference in the active file.
Re: Export all fields
am 26.10.2007 06:13:39 von bill
In article ,
Bill Steele wrote:
> Trying to create a script to archive records. If you do this by hand,
> he dialog allows you to choose "current table" or "current layout." But
> the Export Records script step doesn't offer this choice, and you get an
> export of only the fields in the layout. Best I can think of is to
> create a new layout and put every field in it. Other suggestions?
Ummm, not so . . . .
In the Export Records script step, it allows you to export any of the
fields in the table and any related tables. You are not limited at all
to the fields that show up in the current layout. At least that's the
way it works on mine.
It is true you do not get the option of only showing the fields in the
current layout in the list of fields to be exported. It simply shows ALL
the fields in the parent table of the layout, allows you to select any
of them for export, and also allows you to select any fields from any
related tables.
Using FMA 9 on mac OS X 10.4.10
But I seem to recall that it worked the same way on earlier versions of
FMP.
Re: Export all fields
am 26.10.2007 07:19:53 von Grip
On Oct 25, 10:13 pm, Bill wrote:
> In article ,
> Bill Steele wrote:
>
> > Trying to create a script to archive records. If you do this by hand,
> > he dialog allows you to choose "current table" or "current layout." But
> > the Export Records script step doesn't offer this choice, and you get an
> > export of only the fields in the layout. Best I can think of is to
> > create a new layout and put every field in it. Other suggestions?
>
> Ummm, not so . . . .
>
> In the Export Records script step, it allows you to export any of the
> fields in the table and any related tables. You are not limited at all
> to the fields that show up in the current layout. At least that's the
> way it works on mine.
>
> It is true you do not get the option of only showing the fields in the
> current layout in the list of fields to be exported. It simply shows ALL
> the fields in the parent table of the layout, allows you to select any
> of them for export, and also allows you to select any fields from any
> related tables.
>
> Using FMA 9 on mac OS X 10.4.10
>
> But I seem to recall that it worked the same way on earlier versions of
> FMP.
Yup, that's how it works on all 7+ versions I'm pretty sure.
Re: Export all fields
am 26.10.2007 11:56:04 von unknown
Post removed (X-No-Archive: yes)
Re: Export all fields
am 26.10.2007 15:01:13 von bill
In article ,
Martin Trautmann wrote:
> I'll try a real example.
>
> Imagine a backup script that should save all data. Let's assume the mail
> merge format, since it offers a first record with field names.
>
> Now you want to save everything, every day.
> Automatic execution and file renaming from "backup.txt" to
> backup-$year-$month-$day is already solved.
>
> You have a database with
>
> - Table A: Fields A1, A2
> - Table B: Fields B1, B2
>
> AFAIK you could export records reasonably only by exporting as table per
> table to file per file? (one export to backup-A.txt from A and another
> backup-B.txt for table B)
>
> When you do it manually, you will do e.g.
>
> Goto layout (which does contain B-records)
> Select all records
> (sort or unsort)
> Export records
> -> to file "backup.txt"
> -> with format "mail merge"
> -> encoding "UTF-8"
> ... and take table B, move all fields from the left
> to the right column and perform it.
>
> A script will repeat these steps. When you define the export command,
> you will use this export order again:
>
> B::B1, B::B2
>
> All of this should be done without confirmation, automatically
>
>
> No you will modify your database:
> * rename field B::B1 to B::id
> * rename table B to table "data"
> * create field "comment" in this table
>
> What will happen when you export the data?
> I'd expect that the record will contain
> data::id, data::B2
>
> ... but I doubt that data::comment would be included.
>
> Is there an option to do the same as the manual "move all fields"?
> I guess: no for FMP's Script-Maker, while some external tools (e.g.
> Automator) could do this task on dedicated platforms.
>
> - Martin
I think I understand your point.
To get a complete backup by export, you have to do an export from each
of the tables. You would need separate script steps for each of the
tables.
You can do "move all fields" in the script step when you specify fields
for export. If you add a field later, you will have to go back and
re-specify the fields for export to include the new field,
I think that is what you were getting at.
Re: Export all fields
am 26.10.2007 17:29:51 von unknown
Post removed (X-No-Archive: yes)