Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

The FIND button worked great in my layouts when I was dealing with one set of records. When I was able to divide the data into two sets, filtering governed by a find on one field to separate in the "go to" scripting of both layouts, then the FIND ALL stopped working since it is still returning answers in both data types. I've been trying since yesterday to fix this and I did post in the scriptmaker forum but realize that that was a mistake and it should go here. Which is probably why I have not had any answer.

The script-to-txt export is not perfect, but you'll get an idea at least of the FIND script (the global one) as it stands:

Go to Field [ Recipe title ]

Set Error Capture [ On ]

Enter Find Mode [ Pause ]

Go to Field [ Recipe title ]

Perform Find

If [ Status(CurrentError)=400 ]

Show Message [ Buttons: "OK", "", ""; Data: "You did not enter any find criteria; all records will be displayed." ]

Show All Records

Else

If [ Status(CurrentFoundCount)=0 ]

Show Message [ Buttons: "OK", "", ""; Data: "No records match this request." ]

Show All Records

Else

If [ Status(CurrentFoundCount)=1 ]

Go to Layout [ original layout ]

Else

End If

End If

End If

The "Source" field, the one used to separate the two types of data, has a value list with two values: M (for miscellaneous) and B (for book). I'd like to add filtering on "Source" somewhere in there but that works. I am a real newbie and am obviously doing something wrong, so hopefully somone can help. I'm attaching my solution since that will make things easier.

As it stands, FIND (magnifying glass) doesn't return reliable results and I can't figure out where it's going wrong.

Thanks and hopefully someone can help ... Cheers!

FIND__~1.ZIP

Posted

Go to Field [ Recipe title ]

Set Error Capture [ On ]

Enter Find Mode [ Pause ]

Set Field [source, "M"] <--- Use here to add restriction by source

Go to Field [ Recipe title ] <--- Not needed, doesn't do anything

Perform Find

If [ Status(CurrentError)=400 ]

Show Message [ Buttons: "OK", "", ""; Data: "You did not enter any find criteria; all records will be displayed." ]

Show All Records

Else

If [ Status(CurrentFoundCount)=0 ]

Show Message [ Buttons: "OK", "", ""; Data: "No records match this request." ]

Show All Records

Else

If [ Status(CurrentFoundCount)=1 ]

Go to Layout [ original layout ]

Else <--- Not needed

End If

End If

End If

-bd

Posted

Well, that is absolutely amazing! Thank you! That clinched this last major difficulty. There are more, much smaller challenges ahead, probably, but until I could have a workable db for both types of data, dealing with finishing it up was unimiportant. Now I can get on with the job.

On working with this new find, I did see it would be a great idea to sort the data alphabetically after the find and fiddled and fiddled with that. Kept going back to study your code and the light bulb finally came on (I love when that happens) and I added the sort _before_ the first IF statement. Duh! Works beautifully.

Re some of the vestigial coding, I'd made more changes than I could keep track of, so thanks for alerting me to which ones weren't needed any more. At one time some of them were, _before_ splitting the data.

Thanks once again! laugh.gif

Posted

Me, back again frown.gif

Does this ever happen to anyone? You think you have something down pat and somewhere along the line, realize you don't. Further data inputing brought out errors so I ended up having to strip down the above code to something a whole lot less fancy. In its original form, the find script was great. I didn't write it, though, and only modified it for each use but it seems beyond my capabilities to make it work for this complex situation. I now have just a simple find with 2 buttons where the find enters find mode and a perform find performs the find (with container field and mask button so this second one only shows up when in find mode).

I didn't come on board the forum after work much last night because I spent all my time trying to get this to work since I'm dealing with the two types of data still, M and B. (I'm attaching the file so anyone can see what I mean concretely.) Currently, find is returning all sorts of values even though I put the limiting parts of the above code in it _again_ to differentiate <ARGGGHHH>. I still need the user to be able to find something in MISC layout and for the results to be M type data, and for the results when searching withing BOOK to return B values. This code is so basic, though, that it _should_ be easy to do, I just can't seem to wrap my brain around the problem and am getting nowhere fast. All my efforts last night didn't produce consistent, working results <sigh>. I know my lack of experience is a major problem, but if I don't finish this, no-one else will. Here's hoping someone can so kindly help me out again. Thanks! smile.gif

Cataloguer.zip

Posted

Your Find (M) script doesn't do anything to set the Source field. All it does is go into find mode. You need to change it to:

Enter Find mode

Set Field (Source, "M")

Posted

Exactly, BobWeaver. As I said I stripped it down to nothing. Everything I put the differentiate (which of course involved the set field) didn't do a darned thing. As I mentioned, I put those lines of coding, one by one, all over the script (even the basic one I mention above). TO NO AVAIL, no consistently correct results. I attached my db, zipped, without anything but the basic find because of this. <sigh>

It's another day, so I'm going to try again.

Honestly, give me another month and I just might be able to swing a manual. Believe me, if I had the wherewithal, I wouldn't be bugging the group so much and I'd be studying any and all books I could get my hands on. Unfortunately, my hands are tied. Not only are the books at the library outdated, they're for the Mac. The FMP video series is also Mac and about 10 years old. I TRIED to work with these tools a year ago or so despite that, but after about 2 or 3 months gave up frustrated. I have not not put in the distance, believe me I _have_, I'm just working with no extra funds and inferior tools in terms of instructional ones.

Well, off to try again.

Posted

Just to give a bit more info:

When the Find(M) script executes, it enters find mode and sets the Source field to "M" and then stops leaving the user in find mode. The user then adds additional criteria in whatever fields, and then performs the find. So, the result is a find based on Source=M AND all the other search criteria that was entered. Without the Set Field step, there was nothing to restrict the search to the Misc. records.

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