Ron Cates Posted March 14, 2011 Posted March 14, 2011 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
bcooney Posted March 14, 2011 Posted March 14, 2011 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?
Ron Cates Posted March 14, 2011 Author Posted March 14, 2011 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
Recommended Posts
This topic is 5003 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 accountSign in
Already have an account? Sign in here.
Sign In Now