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

Perform Find() search for value in multiple fields


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

Recommended Posts

Posted

I am creating a search page layout where the user can enter the search criteria into one field, but it pulls up records that have that data in one of any four different fields.

For example, records contain several fields - Name1, Name2, Name3, Name4.

The user enters "Joe" I need the Find to pull up any records contain the name "Joe" in either Name1, Name2, Name3, or Name4.

I have tried using a Perform Find() script step. The user enters the search criteria into a global field called "Search". Then I tried editing the Find Request to look for records whose Name1 value contains the value of "Search"

I kept coming up with zero records found.

Am I going about this all wrong, or is there a way to use Perform Find() and have it find records based on the value of another field? Maybe my syntax is wrong.

Any help will be appreciated. Thanks.

Jason

Posted

You can either create a calculation field of Name1 & "_" & Name2 & "_" & Name3 & "_" & Name4 and perform your find in that field or you can use a script similar to the following:

Allow User Abort [Off]

Set Error Capture [On]

Go to Layout [Find]

Go to Field [gSearch]

Pause/Resume Script [ ]

If [not IsEmpty(gSearch)]

Enter Find Mode [ ]

Set Field [Name1; gSearch]

New Record/Request

Set Field [Name2; gSearch]

New Record/Request

Set Field [Name3; gSearch]

New Record/Request

Set Field [Name4; gSearch]

Perform Find [ ]

If [not Get(FoundCount)]

Show Custom Dialog ["No records were found with the given criteria."]

Show All Records

End If

End If

Go to Layout [original]

Posted

There's a few ways to do an OR search on multiple fields.

1. Using a calc to concatonate the fields together into one field that can be used for searching.

SearchField (calculation, text result) = field1 &

Posted

Thanks to both -Queue- and Ender for responding. I used a script similar to the one explained by -Queue-.

My next question was going to be how to find records based on other field data or the results of a function, but using Enter Find Mode, then setting all the field data, then using the Perform Find[] script step, I was able to do just that.

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