Jump to content
Sign in to follow this  
oilman

using field in one layout to preform find

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

Share this post


Link to post
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'.

Share this post


Link to post
Share on other sites

Ray

Thanks for the information. I used the goto record command - worked like a charmed. Thanks again

Lionel

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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

By using this site, you agree to our Terms of Use.