Jump to content
Sign in to follow this  
Davyth

Newbie - copy field from database to database

Recommended Posts

Davyth

Try as I might, I can't seem to get a script to work which will copy field data from one database and then go to another database and paste that data into a filed in it. It should be simple, and I bet it is, but I just can't find any source that tells me how!

 

Please help. confused.gif

Share this post


Link to post
Share on other sites
Guest Yukon Cornelous

Create a relationship

 

I.E.

DB1 [RecordID] :: DB2 [RecordID]

 

In DB2 define field to to lookup info in fields in DB1 cool.gif

 

This is done by entering the Record ID for DB1 into RecordID in DB2

 

It's either Silver and Gold or Nuttin'

Share this post


Link to post
Share on other sites
Davyth

I'm not sure your suggestion does what I need. I have an estimates file which I want to automatically create a record in the invoices file, copy the RecordID of the record in the estimates file, paste it into the RecordID of the invoices file which will then engender the lookup filling of the other fields. I've done the relationship and lookup parts - it's getting the field info across to the new blank record (which gets created, no problem) that's got me stumped.

 

Thanks for the help.

 

:-) Davyth (-:

Share this post


Link to post
Share on other sites
Johnny Boy

One question. Why two seperate files? Why not just two tables? That said use the set field script step after the new empty record is created. This is much better than cut & paste because it does not require that fields be present on layouts to work.

John

Share this post


Link to post
Share on other sites
torphotog1

omg... how do you create a relationship? why is this so freakin hard in Filemaker... I just want to copy one record from one data base to the other.. I don't want to have to go back to trig class to figure this out. While I appreciate people being on here to help please keep in mind we aren't computer engineers. Lets see.. been at this one hour now... just to copy one record from one database to the other........ arg ! You say this is done by entering ID for DB 1 into Record ID in DB2.... lol.... wtf?? what does that mean exactly?

Share this post


Link to post
Share on other sites
AHunter3

Slow down. Take a deep breath. This is frustrating to you because you don't know what we mean because the terminology is new to you.

 

Please keep in mind that it can be frustrating to us because you don't know the terminology. And therefore, since you're using nonstandard terminology, and we aren't mindreaders, figuring out what you mean is going to be an inexact science at best. I'll do the best I can with what you posted, but have patience with me.

 

 

You want to copy a record from one "database" to another, you say.

 

The term "database" may mean "solution", as in "I created a database to manage the school system of Los Angeles County. It consists of 11 files, which in turn contain 74 unique tables, which are integrated into a single solution".

 

Or it can mean "file", as in "I have a database called MyFile.fp7 and it has 9 related tables and 37 layouts and about 60 scripts".

 

Or it can mean "table", as in "The students database has 5724 records consisting of 86 fields each".

 

 

In the case of a newbie doing a FileMaker database for the very first time, it may not have even come to your attention that one file can hold more than one table. Or why you'd ever want more than one table in your database. Although since you are asking how to copy a record from one "database" to another, presumably that entails copying a record from one TABLE to another whether that other table is in the same file, in a separate file that is already linked to the first file in some fashion, or in a separate file that has never before in any shape way fashion or form had anything to do with the first file.

 

There isn't one single way to copy a record from one table to another; instead there are a whole slew of different ways. Which one is best for you depends very much on things you have not told us; and how to describe any process in the simplest possible terms also depends on things you haven't told us.

 

You could...

 

 

• Isolate the single record in the source table by doing a FIND that makes it the only records in the current found set; then export it; then switch to the destination table and import from the single-record export file you just created.

 

• Create a relationship between the two tables. If they are in separate files that do not as of yet "know" about each other yet, you would have to add each to the other's list of External Data Sources (or at least add one to the other's list; I suppose you would not necessarily wish or need to make it a two-way street) and then create the relationship. If they are in the same file, it's easier. I understand that you are not "getting" relationships yet. You have to understand that for most of us who develop, a database that does not involve relationships is akin to a book without words. 99.999% of our databases are relational; it's what databases are good at, it's what they're for. ANYWAY, what a relationship is is a sort of "pivot" point that defines which record or records in one table is related to, i.e., linked to, which record or records in some other table. For example students and their registered courses. Or recipes and their ingredients. Or even threads on an internet message board and their posts. AND if you had a relationship that let you specify WHICH records in the source table was related to a new record in your destination table, it becomes simple to make all the fields except the anchoring pivot field "look up" through that pivotal relationship and acquire their data from the related source record.

 

• Or you could script the process, using variables. FileMaker's Scripting environment is at least as fundamental to a developer as relationships. It's how you make things happen. You can set a variable to the value of the first field in your source record, set another variable to the value of the second field in your source record, and so forth; then go to the destination table, make a New Record, and set the first field to the value in the first variable, set the second field to the value in the second variable, and so on.

Share this post


Link to post
Share on other sites
This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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

Terms of Use