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

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

Recommended Posts

Posted

Hi All,

Since I am new at FM, I am working in a database that I need to get the field and create a new record in another database. I am wonder how can I write the script to copy the firstname, lastname and there is a option that is "Outstanding" or "Returned", copy it one to their related field in a different table.

Any help will be good.

thank you,

php2005

Posted

There are several ways this can be done. One way is this -

Create a relationship between the two tables so that no matter what, it's a valid relationship. The easiest way is to create an auto-entered text field that simply holds the value "X" in each table. So, the relationship is matching "X" to "X", which will always be true.

Create two global text fields in the first table.

In your script, use the setfield fuction to set the two new global fields to whatever to the contents of firstname & lastname are in Table A. Then create a new record in Table B. Use the setfield function again to set the fields you need in Table B with the contents of the two new global fields.

I use globals all the time since they contain the same info no matter what record I'm on. I typically use them to shuffle information from one table to another, just like I explained above.

You can also use the copy/paste method, but I've found that this is typically too restricting, especially when copy info from more than one field.

Posted

Ahem... there is no need for the relationship. Global fields, in any table, can be accessed from any other table - related or not. So it really doesn't matter where the global field (we only need one at a time) is.

BTW, in version 7 you can define a "x" relationship without the need for any special fields. Just pick any two fields and connect them with the "x" operator.

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