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

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

Recommended Posts

Posted

Would it be better to use a normal FM search or is it better to have a dialog box search?

Which way of searching usually do regular people prefer, people that have no knowledge of FM and for them it is just another program that they have to use at work?

Also is it difficult to make the dialog box preform a search on all fields in a layout - not just one?

Posted (edited)

Also is it difficult to make the dialog box preform a search on all fields in a layout - not just one?
Do you mean search every field for whatever the user enter's into the one custom dialog box field?

Would it be better to use a normal FM search or is it better to have a dialog box search?
I would say FM -- It's easier plus it gives them the ability to search for particular data they've entered into exactly the same fields that they entered that data (seems more straight forward to me personally...)

.. But that being said, I'm not a regular person lol!!

Edited by Guest
Posted

Do you mean search every field for whatever the user enter's into the one custom dialog box field?

Yes, that is exactly what I meant. Is it possible at all?

It would be a handy feature which I wanted to implement as a quick search.

Posted

Will test the search layout, will make a sample db with both search options and will give it out to people I work with to see what they like better.

Posted

Yes, that is exactly what I meant. Is it possible at all?

It would be a handy feature which I wanted to implement as a quick search.

Yes it is possible but would probably involve a loop and a few additinal script steps.

Posted

I tried but was not able to get it.,

I got the custom box to display and ask for input. There is a max of three fields that can be chosen.

I chose my item code as first one and nothing for the others.

I got it to search that first field only. I do not know how can I specify if the found is 0 to move on to the next field and check over there.

Enter Find Mode []

Show Custom Dialog ["Find" ; "Please enter find criteria" ; Products::Item_Code]

If [Get (LastMessageChoice) = 1]

Preform Find[]

Else

Exit Script

End If

I think that somewhere in there I need to put one more If statement saying if found count = 0 (or something like that) go to next field and loop.

That last part is the part that I do not know how to specify mainly saying if the found = ""

A tip in the right direction is appreciated.

Thanks.,

Posted

Well, still not getting it - this script is not working...

Enter Find Mode []

Show Custom Dialog ["Find" ; "Please enter find criteria" ; Products::Item_Code]

If [Get (LastMessageChoice) = 1]

Preform Find[]

Loop

If [Get ( FoundCount ) = 0]

Go to Next Field

Perform Find[]

End If

End Loop

Else

Exit Script

End If

Will try to figure it out but a pointer in a right direction is appreciated.

Posted

Heh, I will be doing this 'till I get it - which might take a while so a little help is greatly appreciated.

I modified the script so that it works as follows but for some reason it only searches the field that I chose for the dialog box, it does not search other fields, how can I specify for it to check in other fields?

Set Error Capture On[]

Enter Find Mode[]

Show Custom Dialog ["Find" ; "Please enter find criteria" ; Products::Item_Code]

If [Get (LastMessageChoice) = 1]

Perform Find[]

Else If [Get (LastError) > 0]

Loop

Go To Next Field ------------------ I think that there is something wrong in this step?

Perform Find[]

End Loop

End If

Exit Script

Posted (edited)

I think you want to store your Find Criteria in a Variable. After the if below store the find Criteria. Something like below.

If [Get (LastMessageChoice) = 1]

Set Variable[Find Criteria; Products::Item_Code]

Perform Find.

If[Get(Found Count)>0

Enter Find Mode[]

Set Field[Next Field to be searched;$Find Criteria]

Perform Find[]

I believe that is the direction you are looking to go.

I dont have FM7(Does it have Variables?) If not use a Global Field.

HTH

Michael

Edited by Guest
Posted

A really stupid question? - in my script menu there is no option: Set Variable - how do I get that - or am I missing something really obvious?

Posted

Thanks, it does not have variables, will test it out and post accordingly.

Posted

I don't believe you need a loop, as FileMaker will look at all records anyway.

The Find Criteria is not being seen by FileMaker

Try something like this

Enter Find Mode [ ]

Show Custom Dialog [ Title: "Find"; Buttons: "OK", "Cancel"; Input #1: Anuviel::Name "Name"; Input #2: Anuviel::Address,

"Address"; Input #3: Anuviel::Phone, "Phone" ]

Perform Find [ ]

HTH

Lee

Posted

I agree a loop isn't needed, but since Lee posted it got me thinking. Is he trying to search every field at once with the same criteria in it(Seems Odd) OR wanting to search one field and if nothing is found search another field using the same criteria?

Posted

In your step:

Set Field[Next Field to be searched;$Find Criteria]

Next field to be searched - do I have to specify what field it is, as I have many fields.

Can I somehow use Go to next field and then set that field?

I set the global text field to search criteria and then but only the first field is still being searched.

Go to Next Field

Set Field [${A-SYS}:P:Search_Text]

Posted

Yes, I want to search all of the fields in a table. If entered criteria returns 0 found in the Item_Code field then I want the script to go to field Item_Title and do a search with same criteria.

I want to go automatically to the next field.

The way it is set up now - works if I use the value that is in the first field IE., item code however if I enter a value that is commonly found in a different field the script is searching for that value in the field specified in the dialog box regardless of the step saying

If the foundcount is 0 go to next field and check for that value there.

Posted

So there is no way to say:

If the first search found nothing

Go to next field and repeat search with same criteria

Without specifying each field individually? - so I will have to make a script saying:

If field1 search return 0 found go to field2 and search with same criteria

If field2 search return 0 found go to field3 and search with same criteria

I will have to hard code each field name into the script? I would not be able to use go to next field instead? Correct?

Posted

Unless there is something I'm unaware of. Look at it this way you only have to do it once. :P

I have spent a long time on some scripts that are pretty complicated, but once it's done it's done.

Posted

Ok., will give it a go ahead then :P, thanks for the help

Posted

It may be possible, but it doesn't make much sense.

Suppose you are searching for "John" in FirstName. If you didn't find any, you want to look in LastName. But if in fact you are hoping to find Elton John, why stop after you've found a John Lennon?

And if no Johns are found either as first or last name - does it make sense to keep looking in the address and phone fields? If the answer - in your case - is yes, then most likely your data structure is wrong: if the fields are similar enough to justify a common search, they probably should be records in a related table.

Posted

The old fashion way is to make a Calculation Field and Concatenate your fields.

New field (Calculation, Text Result) =

Field one & Field two & Field 3

A search of this field, will search and all fields you have put in the calculation.

HTH

Lee

Posted

What I want to achieve is to have the employees always see the same search dialog when they search for something.

I have couple of layouts that look different from each other due to data that needs to be displayed. They all pull the data from the same table however. So when an employee clicks on find a dialog box will open and there he can type in what he is looking for. If it is an item they would type in an item code, if they were looking for all of the items that have a hot attribute to them they would type in hot and the results would come in.

If they would look for a certain item that has hot attribute to them then they would click on Advanced search and would be taken to a regular find layout.

What I want to achieve / avoid is that when they are on one layout and they click find the dialog box will come up and if what they are searching for is not on that layout, if it is found, they will be taken to the other layout. Otherwise they would have to go the the other layout first and then click find.

Basically I want it to work like Find/Replace where it searches all of the fields.

I know how to go to the other layout when the search returns results, I do not understand how I can get the script/dialog box to preform the search loop through all of the fields looking for matching criteria.

Posted

Hmm, that might work, will give it a try with couple of fields.,

Thank to all for helping me in figuring this out

Posted

Lees option actually slipped my mind.

comment makes a good point though. If the first field they are searching is Product_Code and that is what they are looking for, but it is not found, why would you want to continue searching names and addresses and other fields that would NEVER have a Product_Code in them?

This is why I usually keep the user on the layout they normally use and let them choose the field they wish to search.

Michael

Posted

Why don't you teach them to use the Find/Replace that is in the Browse menu?

Posted

Yes, because I do not know what they might be searching for, they do not know. It is complicated (work situation). I want, as I said, when they click on the find a dialog box comes up and no matter what single criteria they put in, will return results if it is in any of the fields in the table.

If it is not possible or extremely tough to make I will not implement that however I am under pressure to do so...

Posted

A concatenated field, i.e an index, might make some sense in such a "search" (it's actually more like a fishing expedition).

However, I am not sure what fields being on layout or not has to do with searching.

Posted

I should teach them., especially warehouse people and related - basically my boss thinks that AOL=Internet and nothing will change his mind.

I just thought I might be able to make a search/replace effect via dialog box so that I might avoid in having to fix what they mess up, if they are allowed access to that feature.

That is why in my other post I asked about log and Comment recommended one, which I will use to track all changes so that when they do mess up / delete something I will be able to see what it was and type it back in.

Posted

Yes, just the other day (last Friday) my boss decided to change our password for our online market place - and of course all of the 3rd parties that we use (granted access through tokens, api) failed to do what needed to be done because the password was changed and my boss was "oh, that can happen?".

Created a lot of work for me., but enough about that, I'm trying to make it as easily as I can so that it will be easy to use.,

If a person refuses to be thought no matter how many time I show them how to set margins in word when printing something out they will never learn.

Posted

The field1 & field2 worked nicely. Thank you so much.

Posted

There are a couple of sites that I would recommend that you visit. One is Database Pros, John Mark Osborne has a ton of example files that you can download for free.

Here is one that may help.

Link

and

ISO FileMaker Magazine.

Matt Petrowsky offers several videos and files for the General Public, and others are restricted to members. The fee for access is cheap, and this one file may be enough to justify the cost.

Link

HTH

Lee

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