Corey-Troy Posted April 15, 2009 Posted April 15, 2009 (edited) I have a script developed that works as required only if there is a found set of records. But if there are no found set of records(Records=0) then i get a pop up message prompting for a modification, continue or cancel of the script. I placed a step [if]in the script to make sure there are 1 or more records found by using a [Count Records>0], if not then to [Exit Script], but i seem to still get the pop up prompt. Is there a way to Exit the script and avoid the prompt? Script below: Go to Layout [ “Register” ] Show All Records Enter Find Mode [ Specified Find Requests: Find Records; Criteria: Register::Days: “≤60” ] [ Restore ] Perform Find [ ] Enter Browse Mode If [ Register::Records < 1 ] Show All Records Sort Records [ Specified Sort Order: Register::Item; descending ] [ Restore; No dialog ] Exit Script [ ] End If Save Records as PDF [ File Name: “file:/C:WINDOWSTemp/Items.pdf”; Records being browsed ] [ Document - Compatibility: Acrobat 5 and later ] [ Pages - Number Pages From: 1; Include: All pages ] [ Security - Printing: High Resolution; Editing: Any except extracting pages; Enable copying; Enable Screen Reader ] [ Initial View - Show: Pages Panel and Page; Page Layout: Single Page; Magnification: 75% ] [ Restore; No dialog ] Send Mail [ Send via SMTP Server; To: GetRepetition ( Register::email addresses;1 ); CC: GetRepetition ( Register::email addresses;2 ); BCC: GetRepetition ( Register::email addresses;3 ); Subject: "The Register requires your attention !!"; Message: "Attached is the Items needing Attention."; Attachment: “file:/C: WINDOWSTemp/Items.pdf”; Email Address: GetRepetition ( Register::email addresses;1 ); Reply-To Address: GetRepetition ( Register::email addresses;1 ); SMTP Server: "******.*************.***"; Port: 25; Authentication Type: None ] [ No dialog ] Show All Records Sort Records [ Specified Sort Order: Register::Item; descending ] [ Restore; No dialog ] Edited April 15, 2009 by Guest
IdealData Posted April 15, 2009 Posted April 15, 2009 You need to enable error capture with Set Error Capture script step. Use: If Get (LastError) > 0 immediately after the FIND request to 'trap' the error and process the remainder of the script accordingly.
LaRetta Posted April 15, 2009 Posted April 15, 2009 Just a few things to help fine-tune your script ... You do not need to perform a Show All Records before a find. A Find always acts upon all records. And you do not need to perform an Enter Browse Mode after a Perform Find. A Perform Find always returns you to browse mode. Anyway, these seem like small things but it is good practice to understand when each script-step is necessary and to remove unnecessary steps (since it slows down your solution). LaRetta :wink2:
Recommended Posts
This topic is 6047 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