Jump to content
Sign in to follow this  
Phillip Holmes

Multiple finds in a script

Recommended Posts

Is it possible to script multiple finds. When I use "Enter Find Mode[]" in my script it forgets about the previous "Enter Find Mode[]" and only runs the last request.

I used variables in my script and so also use "Set Field" after each "Enter Find Mode[]"

Thank you.

Share this post


Link to post
Share on other sites

Look into the Constrain Found Set and Extend Found Set script steps.

Alternatively what you want might be achieved with multiple find requests - these allow OR searches to be performed. Say you need to find people who lived in City = "New York" or "Sydney" or "London"...

Enter Find Mode []

Set Field[ City ; "New York" ]

New Record/Request

Set Field[ City ; "Sydney" ]

New Record/Request

Set Field[ City ; "London" ]

Perform Find []

Share this post


Link to post
Share on other sites

dont quite follow your question...

This will return any records with "New York", "Sydney" or "London" n the city field.

Share this post


Link to post
Share on other sites

Let me go into more detail, every morning i need to run a search to get the following.

ITM Status

CAT Status

plus about 40 other fields.

Currently to limit the records I pull it into Excell and edit it like this.

ITEM STATUS = A,N,O but I have to manually remove all D's

CAT STATUS = C,Y but not X

So what I was thinking was like this:

Enter Find Mode []

Set Field[ ITM Status ; "A" ]

New Record/Request

Set Field[ ITM Status ; "O" ]

New Record/Request

Set Field[ ITM Status ; "N" ]

New Record/Request

Set Field[ CAT Status ; "Y" ]

New Record/Request

Set Field[ CAT Status ; "O" ]

New Record/Request

Set Field[ CAT Status ; "C" ]

Perform Find []

Would this give me similar results without having to do all the editing in Excel?

Share this post


Link to post
Share on other sites

Well in this case, if you have a record with an ITM Status of "D" but also a CAT Status of "Y", then it would show the record since it meets the CAT Status criteria.

Share this post


Link to post
Share on other sites

Good point!

I'm thinking that i would have to get it to do one set (CAT) and then the second set from the results? of the Cat search?

Share this post


Link to post
Share on other sites

Well I am not sure what kind of result you are looking for...

Do you want the results to show that before mentioned record or not? If not, you can do a constrain.

Enter Find Mode []

Set Field[ ITM Status ; "A" ]

New Record/Request

Set Field[ ITM Status ; "O" ]

New Record/Request

Set Field[ ITM Status ; "N" ]

Perform Find []

Enter Find Mode []

Set Field[ CAT Status ; "Y" ]

New Record/Request

Set Field[ CAT Status ; "O" ]

New Record/Request

Set Field[ CAT Status ; "C" ]

Constrain Found Set []

Or you can just omit the ones that you dont want.

Enter Find Mode []

Set Field[ ITM Status ; "A" ]

New Record/Request

Set Field[ ITM Status ; "O" ]

New Record/Request

Set Field[ ITM Status ; "N" ]

New Record/Request

Set Field[ CAT Status ; "X" ]

Omit Record

Perform Find []

Share this post


Link to post
Share on other sites

Mr. Vodka thanks again for your help.

1) No i do not want a CAT=Y, ITM=D result

2)Your script looks like it will do exactly what I need, but I can't figure out how to set the the field to do the following.

( I don't have that field directly in the table i'm using so it actually comes out

Set Field[ ???:CAT Status ; "Y" ]

How do i set it?

3)What would you recommend as a resource to learn scripting?

I do not have any local offerings, and cannot get sent to any of the courses. I've learned a lot on my own - but the scripting is still throwing me off.

I'm starting to feel bad that I am taking so much from these forums.

Share this post


Link to post
Share on other sites

Its okay. We are here to help. I would try the tutorials and get some of the books. Geoff's "The Missing Manual" is good for beginners. Ray's book is always a good resource as well...

I am not sure about what you mean that you dont have that field in the table.

Share this post


Link to post
Share on other sites

I have it all set up , but i don't know how to set up the " A" in the following

Set Field[ ITM Status ; "A" ]

as for it not being there I mean that it is in a separate table

Share this post


Link to post
Share on other sites

Sorry I do not follow...

Share this post


Link to post
Share on other sites

Hi alphanitrate,

Sorry to be jumping in late on this, but I'm confused as to what you are trying to do.

Let me go into more detail, every morning i need to run a search to get the following.

ITM Status

CAT Status

plus about 40 other fields.

Currently to limit the records I pull it into Excell and edit it like this.

ITEM STATUS = A,N,O but I have to manually remove all D's

CAT STATUS = C,Y but not X

Are these hypotetical values, or actual values?

Are you really wanting them to be Hard Coded, or be flexible so that you can change the criteria each time you run the script?

Assuming they are Real Values, and to be Hard Coded, why not just perform a find for Item Status "D", and Omit (same for Cat Status "X" and Omit.

Lee

Share this post


Link to post
Share on other sites

Lee - thanks for you help also..

Are these hypotetical values, or actual values?

Are you really wanting them to be Hard Coded, or be flexible so that you can change the criteria each time you run the script?

Assuming they are Real Values, and to be Hard Coded, why not just perform a find for Item Status "D", and Omit (same for Cat Status "X" and Omit.

Lee

These are actual values.

Assuming they are Real Values, and to be Hard Coded, why not just perform a find for Item Status "D", and Omit (same for Cat Status "X" and Omit.

I don't know how exactly to do it - like mentioned in this post (http://fmforums.com/forum/showtopic.php?tid/193440/tp/1/) i'm new, self taught and doing a large database for a company.

On the plus side I'm 25 minutes away from the "Calculation webinar file maker is putting out.

Share this post


Link to post
Share on other sites

Select the Set Field script step.

Hit the "Specify" button next to the wording 'Specify target field'

Choose your target field.

Hit the "Specify" button next to the wording 'Calculated Result'

Type in "A"

Share this post


Link to post
Share on other sites

try something like this

For all but D

Enter Find Mode [ ]

Set Field [ alphanitrate::ITEM STATUS; "D" ]

Perform Find [ ]

Show Omitted Only

For all but X

Enter Find Mode [ ]

Set Field [ alphanitrate::CAT STATUS; "X" ]

Perform Find [ ]

Show Omitted Only

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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