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

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

Recommended Posts

Posted

I need more help on writing a script that will search across multiple fields with out doing multiple Finds. What I have in mind is the user clicks a Find button that takes the user to a new layout, at that point they enter the job# that they want to find. Then they hit a Find button the invokes a script.

I have gone through all the forums and did a search so I think I'm on track. But I no nothing about scripting. So every thing that I've read is over my head so far. Can some one please Help.

lets say I have 3 fields that I might enter data into. I want to do a find across all three fields!

Thank You For The Help!!!

Devin

Posted

Use a script something like the following:

Go to Layout [ Find ]

Go to Field [ Job Num ]

Enter Find Mode [ Pause ]

Perform Find []

Your find layout has the fields you want to let your user search on. Going to the Job Num field is just a convenience, since once they are on the layout, they could go there themselves. Then you enter the find mode and pause the script, waiting for the user to enter their criteria. At this point, the user can hit enter to continue the script. If the status area is visible, they will also see a Continue button there. If the status area is not visible, you can provide a button on the layout called "Continue" that is linked to "Resume Script"

Chuck

Posted

Chuck,

I know that much, but it does not tell me how to find across multiple fields.

I want the user to enter in one location what job # they want to find. The job # may be in held in several fields. So intern I want to find that one job across all those fields.

Devin

Devin

Posted

Create a field called "All_Job_Nums" and set it to be a calculation. If the job number can appear in fields Field1, Field2 and Field3, set up the calculation as follows:

Field1 & " " & Field2 & " " & Field3

Let's say that Field1 has the data "JOB1234", Field2 has the data "JOB987" and Field3 has the data "JOB5675". Then the new calculation field All_Job_Nums would have the data "JOB1234 JOB987 JOB5675". Placing the contents of two or more fields into a different field is called concatenation.

Now if you search field All_Job_Nums for either JOB1234, JOB987 or JOB5675, the record with that data in Field1, Field2 and Field3 would be part of the found set.

Chuck

Posted

Chuck,

Thank you,

It worked great.!

Is there a way to force the Cal. I noticed that if I changed the Cal after I enter data it would not find the jobs.

Thanks Chuck for all the help that you have given so far.

Devin

Posted

Do you mean that you changed the calculation to include another field, and then tried to perform a search on data in that added field, and you didn't find the record?

Chuck

Posted

Yes and no.

At first thats what I thought. so after I got all my fields in the Cal. I made a records for testing.

I did the find on the cal field and it found every thing.

Then I went back and changed the vaule of the field and the Find would no longer work?

I can see the # in the Cal field, but it still does not find the #

Devin

Posted

I may have found a fix?

On my cal field I told it was text and not #'s

Why is this.

No on to my next issue?

lets say you want to see the jobs that are larger than 100. So After I do the find and get all the records. Say 20 total.

I know wan't to put them in a list . since the job # might be in job_a, job_b or job_c field. How do I get those #'s over to the job_list field. and keep track of there same data. Now data will be in all three but I only want to find the fields that I told it to find

Or is there a better way to do all this. I thought about making the fields a repeating field but I was told that on a list view it will only show the top item.

Thanks

Devin

Posted

Regarding the problem you had with changing the calculation and it not working, are your job numbers stored as text or as numbers?

If I understand your new question correctly, after you have your found set, just go to a layout that is in list view. You might use the New Layout tool in FMP5 to create one if one doesn't already exist.

Chuck

Posted

The job numbers were stored as numbers.

I think I'm going to try another way around the list view. I do know how to make a list but I might have an easier way.

Devin

Posted

Set up a concatenated field that has the contents of all the fields that could have a job number. If your job number could be in three fields, Field1, Field2, and Field3, set up your calculated field to be:

Field1 & " " & Field 2 & " " & Field 3

Then have the job number field that the user searches on be this calculated field.

Chuck

Posted

I usually store IDs as text instead of numbers. Auto enter still works, but I find that text fields are easier to work with when using the fields as relational keys. Your problem may stem from having the keys defined as numbers instead of text. If possible, convert the fields to text. You won't loose the information, but doing what you want will be easier.

Chuck

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