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

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

Recommended Posts

Posted

I thought it will be a great idea to have listing dog foods that I sell with their ingredient list, so that if someone is looking for certain ingredient in the food, I can find them easy.

So I started creating a database with name and ingredient list as fields. I was listing the mail ingredients in "ingredient list" field. However the find does not seem to find more than one thing in the same field. is this correct?

If so, do I have to make separate fields for each ingredient that I'm inputting?

Posted

You need to update your profile to include the version of FileMaker, OS, and Platform.

I'm not sure that I'm understanding you correctly. Are you using a value list with Checkboxes for these ingredients, or are all of the ingredients listed in one field (i.e. corn, oat, grass, etc.)?

aaa could be correct, and you need to do is an OR find, but I'm reading this that you want to find one that meets some or all of ingredients (i.e. a combination of corn, oat, grass, etc.).

An "OR" find would be multiple Record Request, and an "AND" find is one Record Request.

HTH

Lee

Posted

I'm using older mac, os 8.6 with fm5. My ancient imac is not capable of upgreated to newer os.

Anyway, I'm just using text field, and filling them in the ingredient list. I have them separated into grain, meat, oil and such. So for example, one product will have input as follow

Grains: brown rice, oats, barley

meats: Chicken, turkey

oil: Flax

If I'm looking for only one ingredient in that field, find does what it does.(I'm using omit what it fit in the find, and show the rest stuff.) But if I want to look for a products that has rice and oats inthe gran field, then go find, omit those match, it will show all products.

I want to be able to find product that doesn't contain certain ingredients.

So, I was wondering if I have to make additional field such as grain1, grain2, grain3. etc. which I really don't want to do. But if I have to I guess I would have to.. Or, not that I know anything about programing, but maybe there is just simple programing that I can do with help from someone that will fix this?

Posted

Make a new find request for each item in the search. If your field is called 'textField', you have a global text field you can use, and your find criteria is separated by commas, then you can do something like

Allow User Abort [Off]

Set Error Capture [On]

Enter Find Mode [Pause]

If [Position( textField, ",", 0, 1 )]

Set Field [globalTextField, "," & textField & ","]

Loop

Set Field [textField, Trim(Middle( globalTextField, Position( globalTextField, ",", 0, Status(CurrentRequestCount) ) + 1, Position( globalTextField, ",", 0, Status(CurrentRequestCount) + 1 ) - 1 - Position( globalTextField, ",", 0, Status(CurrentRequestCount) ) ))]

Exit Loop If [PatternCount( globalTextField, "," ) = Status(CurrentRequestCount) + 1]

Duplicate Record/Request

End Loop

End If

Perform Find [ ]

If [not Status(CurrentFoundCount)]

Modify Last Find

Show Message ["No records found."]

Show All Records

End If

Posted

There is nothing wrong with the earlier version of FM. I use v6 and v5 mostly anyway.

I'm still a little foggy on what you have, maybe a Screen Shot would help.

However, I'm confused why you are omitting a found set of records, when it sounds like it is the found set you want.

If you have listed the ingredients in one field, have you tried a find in the one field listing the what ingredients you want to find.

Enter Find

go to field ingredients

Enter your find criteria (i.e. Oil oat grain)

Perform Find button

Lee

Posted

Hi Jt,

Well, one of us misread this post. You read it as a OR, and I read it as a and.

Lee

:)

Posted

Queue,

Sorry for my ignorance, but is this the script that I can make in the scriptmaker in fm?

Posted

In that case, you would need a loop, similar to the above, for each field which can have multiple values (if more than one field will be entered, then you would need to add to the Status(CurrentRequestCount) so it exits on the correct request, or use a global number field as a counter instead).

Note that if Omit is checked by the user while the script is in Find Mode and paused, then the omit will be carried through each request because Duplicate Record/Request is used. So it should work for both a normal find and an omit.

Posted

I'm going to try creating a new script. I'm totally new to this and I have no idea what each one means.. Hopefully I will suceed. Wish me luck.

Thanks guys for the quick response. If I cannot seem to figure things out, I will be back.

Posted

If you need to, you can post a sample of the file and let us know which fields should be included in the test.

Posted

How do I post the sample? Just write them down here?

Manufacture - Solid Gold

Item Name - Wolfcub

Dog Cat - Dog

Type - Dry

Meat - Bison, Salmon meal

Starch - Brow Rice, millet, Cracked Pearled Barley, Rice bran, Amaranth

Oil - Canola, Flaxseed

Others - Garlic, Blueberries, Yucca, Chicory root

I want to be able to search/find in Meat, Starch, Oil, Others.

Do I have to change the text field to global text field? The program said any entry will be eraced when I change to global text field.

I realized that I have no knowledge of what each script means, and I would have to learn.

Posted

Actually, I meant attaching a sample file to your post. You can Stuff it and then Edit your existing post and attach it. Then we can make changes to it and reattach it for you to investigate.

Posted (edited)

I cannot type anything in xfield, such as xMeat, Xstarch etc in the find mode.

It still does not do find/omit on more than one entry in one field... :)

Edited by Guest
Posted (edited)

Update.

I can do find with more than one entry in one field. The problem is in omit option. When I check the omit box to do the find, it returns the records that contain either rice or oat.

Edited by Guest
Posted

You do not enter data into the globals. They are merely there to show you how the data is temporarily formatted. You can remove them from the layout.

If you enter "beef" in Meat, then "rice, oat" in Starch, then select Omit, it will find all records which do not have both beef and rice or beef and oat. If you want to find records which do not have beef, rice, or oat in them, then enter "beef,", then "rice, oat". It will then treat it as an OR instead of an AND.

Any fields containing "," are treated as ORs; all else are treated as ANDs.

Posted

Queue, it is working now. Thank you so much. The reason it wasn't working was I still had my old find script that I was trying to create in it. I took that out, and restarted the program, it's perfect.

Posted

Do i want to adapt this bit of code if i'd like to find a list of non-sequential un-ordered items?

I'll want to look for record id's from a query of something like:

003, 008, 030, 025, 105, 080

Thanks in advance! I can start a new thread if this isn't it :D

Posted

You can use the steps I originally posted for this or you can enter them in a global field, create a relationship between the global and the id field, and in your script

Set Field [globalField; Substitute( globalField; ", ",

Posted (edited)

ah, because i'm actually doing all my critera selection in one file and showing the report in another. The ID's i'm looking for will be narrowed by a group designation (global group relationship) and then i pick the id's i want to see from the smaller group and finally run the report.

I'm using a popup menu for the field format so the users can do a shift+click of the id's they want to see. So i'll have to parse my string by carriage returns instead of commas.

so using your code:

Set Field [globalField; Substitute( globalField; ", ",

Edited by Guest
Posted

one other thing, the ID fields i'm using are type number and not type text... which seems to be a problem.

I have to change the id fields to a text type dont i?

Posted

Yes, if you are selecting multiple IDs via menu, checkbox, or list, the Substitute step is unneccessary. And, if you are searching for ID 003, then the related ID must be text or it will only find 003 when you enter/select 3. There is no good reason not to have id fields as text anyway IMO.

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