Jump to content
Server Maintenance This Week. ×

using field in one layout to preform find


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

Recommended Posts

I am using FM 4.0v3. I have two db which are linked by serial numbers. I want to preform a find in the second db using the main db record serial number to find the matching serial in the second db. I would like to perform this find using an external script for the main db. I ahce create a relationship between thw two using the serial numbers. When the button is push in the main db to activate the external script written in the second db I get this message. No criteria has been enter. Example of script in second db:

Enter browse mode

goto layout

Enter find mode

set field(field in main db,field in second db) also tried set field (field in second db, field in main db

preform find

thanks in advance

oilman

Link to comment
Share on other sites

First let me say that if you've created a relationship to your second file, perhaps the best way to 'find' all the related records is to simply place a portal based on the relationship on a layout in your main file (with some fields from the second file placed in it). Then whenever you look at a record in the main file, it will include (within the portal) a scrolling list of all the related records in the other file.

If you then still need to view the records from within a layout in the other file, a relatively easy way to do this is with the script (or button) command Go to Related Record [show, "YourRelationshipName"] When the 'Show only related records option is selected for this script/button command, it will automatically present you with an extract list of the related records in the second file.

Having said the above, if you still want to go about it the way you were trying, that is possible also. What you'd have to do is create a global field in your second file, and have the script in your first file write the current record serial number to the global field in file 2 first (using a 'Set Field' script step). Then your script in the main file should call the script in file 2.

The script in file 2 should then run along the lines you had envisaged, but using the global field value rather than trying to source the value from the other file directly.

The reason it didn't work the way you were trying it is because the relationship between the files is not valid while you are in 'find' mode (which is the point at which you were trying to use a 'Set Field' command to retrieve a related value from the first file?!) - whereas global field values are still available when in 'find mode'.

Link to comment
Share on other sites

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