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

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

Recommended Posts

Posted

I have a membership table.

There is a field called Mem_Can that holds either "Member" or "Candidate"

There is a field called TYPE which holds the membership 'type' (Life Member, year member etc)

After importing records, it is possible for Type to erroneously be ""

There is a calculated field called TypeIndex which calculates the numerical position of the 'Type Dropdown' list of types. It holds 2 if the chosen Type is the 2nd choice etc... If a list of Types is imported the stated Type can be wrong. In this case, the TypeIndex is 0 (zero)

So, I need a way to PerformFind:

Members with a Type of ""

OR

Members with a TypeIndex of 0

I need a get(foundcount) that shows the total of either of these two situations. I need to do this in a script without user input. (Hence, the Perform Find)

Posted

Try

Enter Find Mode[]

Set Field[TypeIndex; ">0"]

Set Field[Type; "*"]

Perform Find[]

Show Omitted Only

This uses DeMorgan's Theorem, which says that A or B is the same as not (not A and not B).

In this case A=( TypeIndex = 0) so not A= (TypeIndex > 0).

B = (Type = "") so not B = (Type = *).

The two set fields in the same find command perform the and function.

The show omitted step performs the final not function.

Posted

Is it required that I enter find mode? Can't the script step Perform Find followed by Constrain work? FM seems to 'allow' this combination but noteably it fails to work.

To put it another way, "If I wanted all 'Sculptors' who lived in NY, why wouldn't I do a Perform Find where State = "NY" and then Constrain where Artist="Sculptor" ????

Posted

Constrain is more often used when a found set has previously been defined in a different way, e.g. with a go to related record step; or when you have to do something with a found set, and then do something else with a subset of it. I have noticed that it is a lot slower than a simple find; really noticeable on a hosted database.

I find it much easier to follow if I spell out the find criteria rather than use the Perform Find [Restore] with the criteria embedded in the command. This may only be because I •have to• do it that way in the PHP interface to FileMaker. But the criteria in the Perform Find[restore] step don't show up in the script editor--you have to open the script step to see what you were searching for.

It is much cleaner just to

Enter Find Mode

Set Field[state; "ny"]

Set Field[artist; "sculptor"]

Perform Find[]

It does the job quicker, and is easier to troubleshoot down the road.

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