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

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

Recommended Posts

Posted

I have a series of related tables that use an ID field for the relationship.

In TableA, I want to add a new record by opening Table B in a new window, so that I can do a search for the relevant record.

When I have found the relevant record, I want to run a script that will copy the ID for THAT record and paste it into the ID field of the NEW record in Table A.

Thus, the window for Table B forms a small "lookup" window that is separate from the main layout window for Table A.

I have tried a number of combinations of copy/paste actions in the script for the Table B lookup.

Do I need a second script that is run from within Table A window to paste the ID from the Table B lookup window?

Thanks,

Charlie

Posted (edited)

you would have to perform the search in table b copy the info then have the script go to the table a layout that you want create a new record then paste the info or am i not understanding your problem

Edited by Guest
Posted

Charlie:

Cutting and pasting is a problematic method for accomplishing this, mainly because it places the ID data in the clipboard, where it can then mistakenly be pasted into somewhere else. Remember that if you do another copy/paste and the field to be copied is blank, then the clipboard is not replaced, in which case you end up pasting the wrong data into a field.

Preferably, you would have a global field in Table B, and you would use Set Field[] to place the record ID into the global. Then, you can use Set Field[] in the new record in Table A to get at the globally stored value in Table B.

This method is pretty standard practice in FileMaker development.

-Stanley

Posted

I set-up the Global fields and SetField script, it works great. In fact, I made things even easier, by utilizing a Custom Dialog Box in which I can enter the ID number (this is easily available already).

Thanks for the help.

Charlie

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