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.

Exit After Last. Then What?

Featured Replies

Hi All. I have a layout where employees can go to print what we call Sets. The script goes to the Sets layout, loops through till it gets to the next set that has not been printd, stops there and prints the set. After printing it tags that set as printed on this date by said employee. That all works great. The problem I'm trying to figure out is what to do if all sets are printed and how to specify a dialog if the loop gets to last record and exits without finding a Set to print.

Here is my script.

Perform Script [ “User Abort” ]

Perform Script [ “Set Error Capture” ]

Set Variable [ $param; Value:Evaluate ( Get ( ScriptParameter )) ]

Go to Layout [ “Sets_Form” (Sets) ]

Enter Find Mode [ ]

Set Field [ Sets::_fk_job_id; $Job ]

Perform Find [ ]

Sort Records [ Specified Sort Order: Sets::set_number; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]

Loop

Exit Loop If [ Sets::set_type ≠ "Repeat" and Sets::set_type ≠ "Tap" and IsEmpty ( Sets::printed ) ]

Go to Record/Request/Page

[ Next; Exit after last ] <----- If it gets to this point and exits, I would like to have it do something else.

End Loop

Perform Script [ “Print Set” ]

Go to Layout [ original layout ]

Go to Object [ Object Name: $object ]

Any suggestions would be appreciated.

Thanks

Ron,

What is the script parameter and why do you feel that you need to wrap it with Evaluate()?

Why not find for Sets that have your $job and Sets::Printed is empty (just set the field to "=" without the quotes)?

Then, if get(foundcount)=0, you can pop a dialog and stop right there.

Basically, why the loop?

  • Author

The evaluate part is a method of passing multiple predefined script parameters. Your suggestion makes a lot of sense. I'll rework it tomorrow. Seems like I had a spacific reason for the loop when I planned it, but it escapes me right now. Either way I'm pretty sure doing a find for unprinted makes better sense. If I run into any reason that it won't work I'll be back.

Thanks

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.