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

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

Recommended Posts

  • Newbies
Posted

I used to use a copy step in a clients file and an external script in a contracts file to place client data into a new contract. Haven't been able to figure this out in FM7. It doesn't work the same way. I'm a little embarassed about this, because I'm quite sure it's very simple. Can someone please enlighten me?

Posted

Hey dogman,

Copy and Paste work the same way in FM7; you need to have the fields on the current layout. However, it is almost always preferable to leave the clipboard intact, and use Set Field[] to set values in other tables or files. For this to work, there must either be a relationship setup to the target table/file, or you may use globals to pass values. Another approach is to use script parameters to pass data (check the manual for the basics on how these work, also, the application help's explanation of the Evaluate function for encoding multiple values in one script parameter.)

Perhaps you were having trouble calling the external script. This is done by adding a file reference to the external file (under File->Database->File References.)

  • Newbies
Posted

Thanks for the response, Ender!

I had read that copy and paste wasn't the best idea anymore, and suspected that what I was after had something to do with the Set Field step.

There is a relationship between the tables. Not sure how to proceed with using Set Field, though. My Clients table has a serial field in it, and that's the match field between the Clients and Contracts tables. I'd like to script a button in the Clients table to create a new Contract record, then send the serial value from the Clients table to the Contracts table to have access to all the Client data. How would I use Set Field to do this?

Thanks again!

Posted

If your relationship is set to allow creation of related records, then it would be easiest to do this using a portal to the Contracts table. Typing into a new line of the portal would create a new related record automatically.

However, if you don't want to use a portal, you can set a global field with the Client's serial, then call a script to create a new record in the Contracts table, and then set the new record's client serial field with the global (which can be accessed from either table without using a valid relationship).

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