Jump to content

Reality Check re: multi-criteria scripted find


Courtney
 Share

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

Recommended Posts

Ok, I've been staring at this for a few days and have pages of notes to myself about possible ways to do this, but I'd like some input on whether I'm overlooking some nice clean way to do this.

I'm working with a table "Timesheet" where employee timesheet records are stored, and table "ReportPreferences" where I'll store user preferences about the types of reports they run most frequently.

In "ReportPreferences", I've got a field "EmpCode" and a field "ActivityType" each of which are formatted as checkboxes from value lists stored in other tables (Activities and Employees).

If a user selects multiple criteria in one or both of these checkboxes, how can I best turn those choices into a scripted find (i.e., if they selected EmpCode of 1 and 3, and ActivityType of 2 and 6, how can I script a find to look for every Timesheet record either employee 1 or 3 performed either activity 2 or 6)?

What I'm trying to do script-wise would be something like this if it's possible:

Enter Find Mode

Go to Layout ["TimeLookup" (Timesheets)]

Set Field [Timesheets::EmpCode; {first choice selected from checkbox}]

Duplicate Record/Request

Set Field [Timesheets::EmpCode; {second choice selected from checkbox}]

Perform Find

To complicate matters (maybe), there may be up to 60 or so employees selected on a single report, though I am also providing some grouping options (all employees in Group A, all employees in Group B, etc.)

I'm also open to "you're going about this all wrong!" if anyone has a better suggestion. :

~Courtney

Link to comment
Share on other sites

Hi Courtney,

You do not need to script the find this way. Take advantage of relationships. If you use as multiple key fields, the EmpCode and ActivityType then you can simply use a Go to Related Record step to get to the records.

Take a look at this brief sample. The portal is only there to display the related records. The button with script goes to them.

GTRR_example.zip

Edited by Guest
Link to comment
Share on other sites

Thank you so much. This looks like it will make several things much easier. If only I had the time to really learn everything FM has to offer instead of going on these hunting expeditions for specific solutions!

Appreciate the help.

~Courtney

Link to comment
Share on other sites

This topic is 5701 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.