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

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

Recommended Posts

Posted

Is there a way to use the find command to find when two fields equal each other.

ie. return all the records in which Quiz1Score = Quiz2Score ?

Posted

There may be an easier way, but one solution that comes to mind is to create a calc field

C = case (A=B;1)

Then find for C=1.

I don't think there is a simple way to just go into find mode and do it with A and B alone, but I'd like to be proven wrong.

HTH,

Dan

Posted

Exact(FieldA, FieldB) will return a 1 when true, you can then do a search for 1 and you will get what you asked.

HTH

Lee

cool.gif

Posted

A = B will work also.

It will work because it is a Boolean, right JT? And true produces 1? You aren't suggesting this be entered in the Find criteria, right? I just wanted to be sure I understood this.

I assume you mean Boolean because that's one of your specialties. smile.gif

Posted

Yes, it's a boolean test. We were talking about calculation fields to make the find easier. The find criteria in either of our 3 examples would be 1. And in Lee's and my calc, the criteria would be 0 to find records where A <> B. For Dan's it would be =.

  • 2 months later...
Posted

OK....so how do you implement this? sorry old message but same problem. I want to attach this to a button...so using scriptmaker what do I use to find records using this calculation??

Thanks

Posted

Hi,

Create a calculation (number) similarly as discussed above (A = :. Then your script ...

Set Error Capture [On]

Allow User Abort [Off]

Perform Find [Restore ] ... in the Specify Find Requests, click New and select the calc field and type only a one (1) in the criteria. You do not need the = nor do you need to put quotes around that number. Also, if there are any prior finds listed above, remove them first. Then your script will continue as ...

If [ not Get(FoundCount) ]

Show Custom Dialog [ "No records found" ] you can just have an OK button and not a cancel if you wish. This would depend upon your needs.

Halt Script

End If

... then do whatever you wish here with the records that are found.

Posted

OK...i'm stuck yet again (and embarrassed at my fm ignorance!)...

Now I would like to add some more conditions to this, basically to perform a find based on three fields; employee, project and date.

BUT i need it to be conditional based on if they have filled the feilds (eg. may want to find employee AND date, but leave project empty)...i tried to do it myself, but keep failing frown.gif

again I really appreciate your time!!

Posted

No problem, iondesign. We all are FM-ignorant whether we admit it or not ...

Place the three fields with conditional criteria - Employee, Project and Date on a layout for your Users to enter something into. Leave your Perform Find intact (with the calc =1). Add the following step right before the Perform Find:

Enter Find Mode [ pause ]

Do not specify any find requests in the Enter Find Mode [] script step; in fact, open it and make sure it's empty. Delete any pre-existing finds listed.

What will happen ... FM will enter Find Mode and hesitate. Your Users will enter anything they wish into the three fields - the conditional criteria. When they hit [enter], the Perform Find script-step will add the calc = 1 to what they have entered and the Find will produce the resultant records. wink.gif

Posted

OK...i'm a little over my head i think...i'm guessing the problem is that the calc is testing the date and i'm not 100% what fields should be where...

IF you don't mind I'm attaching the file, only if you have a spare moment do you think you could check it out??

The script that's in question is "filter_records" also note it's all pretty rough looking...i'm just trying to work on the functionality!!

Thanks again.

riky

timesheets.zip

Posted

Hi Riky,

You've just about got it. A few things ...

1) You must run the Filter Records as a Perform Script at the end of your Filter Window. Otherwise, Users are placed on the Filter form in Browse mode where they would/could edit real data by accident.

When they, from there, click the Show Records button, the script then enters Find Mode to allow User input.

Also, right before your Halt Script, you may wish to return Users to the Timesheets Entry page and also include a Show All Records. Users left stranded on a Search page (your Filter) or a List view with no records is a bit unsettling to them.

See if that makes a difference for you. smile.gif

I am unsure why you are using your dates in a comparison calc to isolate your records; and then again placing D2 on the layout for your Users. Since I don't know the purpose it may well be logical. If it still doesn't produce the results you require, say a bit more about those dates, okay? ... what they represent and what you are trying to accomplish with the two dates; but I think the above might do it.

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