Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

user parameter script assistance, please

Featured Replies

Hello,

I am trying to automate a constrain on a report with user parameters. There is a report that is pulled with all these conditions (already scripted in Summer 672)...

Since the report has so much data, the user likes to preview it on screen prior to printing. So if the user just wanted to see a certain dept's pages in this huge report, I would like to make button so they user inputs what dept they would like to constrain the report to

I don't know how to do this and to set up error catching on it..... we have 16 or so depts and don't want to set up 16 buttons (one for each dept).

here is what I have so far... and it's wrong

-Perform Script [ “Summer 672” ]

-Show Custom Dialog [ Title: "Dept"; Message: "Please enter Dept Code"; Buttons: “OK”, “Cancel”; Input #1: Dept::dp_code ]

-If [ (Get (LastMessageChoice) = 1) ]

-Constrain Found Set [ ]

-End If

Your advise is greatly appreciated. Thanks in advance

Edited by Guest

You would need to reenter Find Mode, set the new criteria, then use Constrain Found Set.

However, I do this type of thing a little differently. I use a Find screen, with specific fields on the layout (like Department) that allow narrowing down the report in the initial Find. The script would then be a little simpler:

...

Go to Layout [ Report Find ]

Enter Find Mode []

Go to Field [ Department ]

Pause Script [ indefinately ]

Perform Find []

Go to Layout [ Report ]

Sort Records [ Restore ]

Enter Preview Mode [ Pause ]

...

  • Author

I tried it both ways... and can't seem to get it to work....

Here is the constrain script with user parameter requested:

<>

Enter Find Mode [ ]

Perform Find [ Specified Find Requests: Find Records; Criteria: Job::jb_emptype: “="Staff"” AND Contract::c_display_active:

“="Active"”

Find Records; Criteria: Job::jb_code: “=2481” AND Contract::c_display_active: “="Active"”

Find Records; Criteria: Job::jb_code: “=2482” AND Contract::c_display_active: “="Active"”

Find Records; Criteria: Job::jb_code: “=2360” AND Contract::c_display_active: “="Active"”

Find Records; Criteria: Job::jb_code: “=2361” AND Contract::c_display_active: “="Active"”

Find Records; Criteria: Contract::cn_tb_decimal_winter: “>0” AND Contract::c_display_active: “="Active"”

Omit Records; Criteria: Job::jb_empsubtype: “="Temp Hourly Intermittent"”

Omit Records; Criteria: Contract::c_display_active: “="Inactive"”

Find Records; Criteria: Job::jb_code: “=3306” AND Contract::c_display_active: “="Active"”

Find Records; Criteria: Job::jb_code: “=2355” AND Contract::c_display_active: “="Active"” ]

[ Restore ]

Show Custom Dialog [ Title: "Dept"; Message: "Please enter Dept Code"; Buttons: “OK”, “Cancel”; Input #1: Dept::dp_code ]

If [ (Get (LastMessageChoice) = 1) ]

Constrain Found Set [ ]

End If

<>

Because the find is so complex to get the report correct for payroll....I thought the constrain would be an appropriate method.... when I run Summer 672 approximately 400 records appear and if I only want to see the 20 in the Com Dept....

Your assistance is very appreciated.

  • Author

Also, it works if I make buttons for each dept- approx 16-17 depts

This simple script works:

<>

Perform Script [ “Summer 672” ]

Constrain Found Set [ Specified Find Requests: Find Records; Criteria: Contract::c_display_dept: “="DO"” ]

[ Restore ]

<>

But not being experienced with user parameters steps, I am hitting a learning curve.

Thanks in advance for your time

(PS the Summer 672 script does that convoluted Find)

For narrowing by Department within the initial Find, the Deparment would need the desired criteria in each request. In this case, it would be easier to contrain the found set afterword.

The complexity of your Find criteria make me think there may be a better structure that allows a Find for just those people in the selected group (the group would include anyone in those numerous departments, or more simply, include each of those departments). I'm guessing from what's here, that this would be a Group-Department join table.

BTW: When you have Omit criteria in the Find, the Omit Records requests should be after all the Find Records requests.

  • Author

BTW: When you have Omit criteria in the Find, the Omit Records requests should be after all the Find Records requests.

I thought so too, but there doesn't seem to be any way to move the lines in the Find step of Scriptmaker. I don't have arrows or any icons.

Should I do the line ordering manually?

You can duplicate the Omit lines then delete the originals.

But I prefer to use a series of New Record/Request steps followed by Set Field[]s for adding multiple requests to a Find. It's a little clearer when reading through the script and makes it easier to set dynamic criteria.

  • Author

I am about to clean up the omit line order....

but how would I put in a constrain with user parameter for dept or last name or something

So for instance, out of the 400 records that pull on the report, the user wants to check that John Jones is displaying on the report.... how could I script the Custom message and Constrain?

I really am grateful for your advice and patience.

What you had was pretty close. I think this would work:

//After the initial Find

Enter Find Mode[]

Show Custom Dialog [ Title: "Dept"; Message: "Please enter Dept Code"; Buttons: “OK”, “Cancel”; Input #1: Dept::dp_code ]

If [ (Get (LastMessageChoice) = 1) ]

Constrain Found Set [ ]

Else

Enter Browse Mode[]

End If

You should probably add some error trapping to deal with the possibility of the department being left blank or not finding any records.

  • Author

Thanks bunches for your help!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.