Jump to content
Server Maintenance This Week. ×

First Post, Script to Find current record field contents


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

Recommended Posts

This is my very first post here. :)

This is what I got so far:

Copy [select; Main::Procedure Number]

Go to Layout ["Procedure Report" (Procedure)]

Enter Find Mode []

Paste [select; Main::Procedure Number]

Enter Preview Mode []

Print []

Go to Layout ["Assembly" (Main)]

Enter Browse Mode []

I know that I am probably going about this all wrong. The current problem with this script is the user has to press enter or click on the button "Find", where it would be nice to have the script just click find for me.

My main layout "Assembly", has a Portal with related records. The layout "Procedure Report" is a list. Why I didn't post this in the printing section of the forum is because I'm not having problems actually printing, but rather to Perform a Find based on the current record field.

So... basically I want to search on the value of a field.

So how do I "Perform Find" on any:

1) Contents of the Clipboard

2) Value of a particular field

3) Paste into find???

I'm really lost on how to do this, please help a FileMaker newbie. Thanks in advance.

Link to comment
Share on other sites

Ok, maybe I wasn't very clear, in a nutshell:

Consider the following:

Record "1" and Field "A" value is: "Happy"

Record "2" and Field "A" value is: "Sad"

Record "3" and Field "A" value is: "Calm"

How do I perform a find for "Happy" from "1A", but if I'm on "2A", search for "Sad" instead or if I'm on record "3", find "Calm".

It seams like this would be very easy, coming from a SHELL scripting background, but this ScriptMaker got's me going bonkers.

Please help.

Link to comment
Share on other sites

Since you have FileMaker 8, you can also do this without a script: control-click the field, and select Find Matching Records from the contextual menu.

Thanks for the suggestion, however I am trying to do this in a script.

Link to comment
Share on other sites

Since you have FileMaker 8, use a script variable to transfer the contents of FieldA from the current record to find mode.

Set Variable [$Search; Value: MYTABLE::FieldA]

Enter Find Mode []

Set Field [MYTABLE::FieldA; $Search]

Perform Find []

I'm a little unsure about the first line:

Set Variable [$Search; Value: MYTABLE::FieldA]

What do I put for Value?

Link to comment
Share on other sites

Now how do I use this variable in conjunction with another search parameter?

Meaning, how do I perform multiple search's?

Originally I had 2 different problems that have now melded into one problem, this is the reason for multiple posts:

http://fmforums.com/forum/showtopic.php?tid/176285/

Please, anyone who can help me with this?

Link to comment
Share on other sites

I was able to figure it out on my own and once I thought about it more, it was actually quite simple:

Go to Layout [ “Assembly” (Main) ]

Set Variable [ $Search; Value:Main::Procedure Number ]

Set Variable [ $Filled; Value:"full" ]

Enter Find Mode [ ]

Go to Layout [ “Report - Picture” (Procedure) ]

Set Field [ Main::Procedure Number; $Search ]

Set Field [ Procedure::PictureCalc; $Filled ]

Perform Find [ ]

Enter Preview Mode

Print [ ]

Enter Browse Mode

Go to Layout [ “Assembly” (Main) ]

I just added another "Set Variable" and "Set Field" to add more criteria to my search. Thanks for your help with the other topics.

Link to comment
Share on other sites

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