Jump to content

issue w/ Script that has multiple Finds


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

Recommended Posts

i have a music database. each record is an album by an artist. (there are several other fields that are irrelevant here.) most records (albums) are owned, in which case OWN = "T" and WISH LIST = "F". some records are on the wish list, in which case OWN = "F" and WISH LIST = "T". i have an Artist Search script where you first go to a layout that lets you enter the artist. then, the script proceeds with another Find where I get to limit the results to weed out records where WISH LIST = "T" because I do not want my Artist Search to show records I don't own. i only have to do the second find once, as i can go back into the script and turn the pause off and remember the limiting criteria. (using constrain found set on the second find.) SO - here's what's going wrong...

when i initiate the Artist Search and enter a bogus artist name, it says No Matching Records. I then click Modify Find and am able to enter an artist whose records i own and proceed with no problem.

when i enter an artist that is on the WISH LIST (and ONLY on the WISH LIST), of course I get the same No Matching Records message, but this time because it failed the 2nd "pass-through" Find, not the first. therefore, when I click on Modify Find, I'm taken to the "Limit Criteria" layout. the artist name is already "in memory" from the first find and the only thing i can modify are the limiting criteria that made the 2nd Find fail.

I need to be able to restart the script from the very beginning if the 2nd Find returns no matches basically. Preferably by clicking Modify Find and not Continue, but I'll take what I can get.

Anyone know how to solve this one?

Thanks,

Sparrow

Edited by Guest
Link to comment
Share on other sites

Take a look at these sites, they may have your answer.

http://www.kevinfrank.com/demo-files-78.html (Download "State Awareness: demo.)

http://www.filemakermagazine.com/search/node/Search+techniques

(This will give you a list of all of Matt Petrowsky's techniques.)

Without being familiar with your data and your application it is not a simple answer.

HTH

Link to comment
Share on other sites

here's the script i'm working w/ in case it helps anyone w/ troubleshooting the problem:

Go to Layout ["Artist"]

Enter Find Mode [Pause]

Perform Find [Replace Found Set]

Go to Layout ["Layout #1"]

Enter Find Mode [Restore]

Perform Find [Constrain Found Set]

Go to Layout ["Artist Report"]

Sort [Restore, No Dialogue]

Again, when I first entered the script, the 2nd Find was Enter Find Mode [Pause] so I could enter the additional criteria that would weed out records where OWN = "F" and WISH LIST = "T". After the first time I ran the script, I simply changed the 2nd Find to Enter Find Mode [Restore], which removed the pause and kept the criteria I entered the first time, making the 2nd Find an automatic "pass-through" from then on.

I realize that I could set it up to where there's just one Find where I specify all criteria, but I thought it would be more interesting if the user only ever saw the one Artist Entry layout (1st Find) that only shows the Artist field and says "Enter an Artist".

I'm only having trouble in the following situation: There's a particular Artist in my database that I ONLY have records for where OWN = "F" and WISH LIST = "T". When I enter that artist in the 1st Find, FileMaker finds records. It's only in the 2nd "pass-through" Find where unowned Wish List records are weeded out that it says No Matching Records Found. When I click Modify Find, it returns me to the 2nd Find layout, "Layout #1", where it's too late to enter a different Artist.

Hope this is making sense.

I have an idea to try. I think I will set it up to where there's only one Find. Initially I will use Layout #1, which shows all fields in order to be able to enter OWN and WISH LIST criteria. The first time I run it, I will only enter "T" for OWN and "F" for WISH LIST. I will then set the script to remember those criteria. Next I will change the script to use the Artist layout, which only shows the Artist field. Even though it only shows that one field, I assume it will still remember the selections I made in the other fields if I use Enter Find Mode [Restore, Pause]. At that point I will be adding the final criteria: which Artist to search for. As I re-run the script over and over, I expect it will only restore the OWN and WISH LIST criteria, giving me the chance to enter different Artists each time while keeping the original entries I made in OWN and WISH LIST. I'll be specifying all 3 criteria every time, but OWN and WISH LIST will be automatic and hidden, the two things I want them to be.

Any other solutions?

Thanks,

Sparrow

Edited by Guest
Link to comment
Share on other sites

no luck with the Set Field idea. the idea i had in last post works inconsistently. for some reason, sometimes when i enter back to back artists that are not in my database, instead of continuing to get the Modify Find / Continue / Cancel options, it exits the script and i'm left seeing the Artist Report layout still in Find mode. although sometimes i am able to alternate between artists that yield no matches and artists that do without a problem. is there a way to set up a loop that repeats until OWN="T"?

Edited by Guest
Link to comment
Share on other sites

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