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

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

Recommended Posts

Posted

I want to automate a copy command between two tables in the same file by using a script. The tables looks as :

Table1 :

Rec 1 fieldname1 “info1”

Rec 2 fieldname1 “info2”

Rec 3 fieldname1 “info3”

Rec 4 fieldname1 “info4”

Must be copied to

Table2 :

Rec 1 fieldname1 “info1” and fieldname2 “info2” and fieldname3 “info3” and fieldname4 “info4”.

I using the following script but it doesn’t work !!!

Go to Layout [Table2]

New Record/Request //Prepare empty rec.

Go to Layout [Table1]

Go to Record/Request/Page[1] //Only for sure !

Loop

Copy[select; Table::fieldname1]

Go to Layout [Table2]

Go To Field[select/perform]

Go To Next Field

Paste [select]

Go To Next Field

Go to Layout [Table1]

Exit Loop If[Get ( RecordNumber )=4]

Go to Record/Request/Page[Next]

End Loop

The problem is the switch to table2 just before the paste; No field is selected at that moment. How can I perceive in which field I was the last time??

THKS for helping me out !!!

Posted

This is a FAQ, no developer in his right mind would with inner applicational use copy/paste because it wipes what ever the user might have stored in his/her clipboard for other purposes - and is really a no-no!

Next aspect is that filemaker actually is an attempt to be a relational database tool. So the desire to have the same data in two locations isn't fully embraced, due to syncronization issues.

Here should a distinction be made whether the data stored are historic statement, suchs as price which are likely to change after the quote have been send to the customer, this is the only place where some kind of copying is justified at all, but it should prefrerable be done with a autoenter calc, utilizing the Lookup function.

All other persuits in that direction should be solved with relational mechanics, with perhaps some few exceptions utilizing Set Field( and $Variables in a combo!!!!!

--sd

Posted

I completely agree with Soren, on all his points. What is your purpose of having the same data in the two tables here?

Posted

If you really wanted to duplicate the data (all Soren's points as to why you shouldn't are valid) but if you did:

Go to Layout [Table2]

New Record/Request //Prepar e empty rec.

Go to Layout [Table1]

Go to Record/Request/Page[1] //Only for sure !

Loop

SetVariable[ $value ; Table::fieldname1]

Go to Layout [Table2]

Go To Field[select/perform]

Go To Next Field

Insert Calculated Result[ select ; $value ]

Go To Next Field

Go to Layout [Table1]

Exit Loop If[Get ( RecordNumber )=4]

Go to Record/Request/Page[Next]

End Loop

Posted

I know I know :

,but this script is a part of a import script where I tray to fill to tables from one import/script action so I can build up my relation.

Posted

Ah, may have misunderstood your question, just put it into different repititions of the variable and then parse them out in table 2... really redundant thing to do. I'm with the Soren and John, please explain.

Posted

Ok I shall explain the whole situation :)

All my information is in a Excel file, and my customer wants it in FileMaker !!! So I have made a FileMaker file with several tables and layouts and with the same (and more of course !) functionality as the Excel file. So far so good !!

At the end all data must be transported form Excel to FileMaker, and the customer want to do it himself, because of the amount of Excel sheets.

So I have to make a ‘foolproof’ script to import those files. And to make it easy for the customer I only want to import a Excel file ones.

What I discovered by importing files was that it’s not possible to divide the importing data over more then one table.

So what I have done is that I import (read) all information and put it in one table. Most of the information is directly on place but I use the last 6 records of table for information for the second table as filename information (Which is my relation key), version, creation date and other dates.

Now I want copy (transport) this information to table2 and if I am sure it’s ok I delete the last 6 records of table1.

When this is ready the FileMaker file is ready for use as relational database !!!

I hope you understand now the meaning of my first question, and thanks for helping me out !!!

Posted

Sorry Genx,

But your script doesn’t work…

If you go to next field and you switch to another layout and come back he is the field selection forgotten and will start in it’s first field. Can a here work with a variable as well, and number my fields :)

Posted

The script won't work exactly as i've done it, to be honest it was a bad example.

The idea behind it is that you loop through all the fields in your layout collecting their data into a variable, THEN you switch, and you use insert calculated result to parse the values out into the fields on your next layout.

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