Newbies exboroboy Posted June 1, 2010 Newbies Posted June 1, 2010 Hello hopefully someone can help me. I am trying to script Filemaker with the following script Go to Layout [ “Holidays This Period” (approval) ] Set Error Capture [ On ] Loop Perform Find [ Specified Find Requests: Find Records; Criteria: approval::time off email sent Yes No: “=YES” ] [ Restore ] If [ Get ( LastError ) = "401" ] Replace Field Contents [ approval::time off email sent Yes No; Replace with calculation: "No" ] [ No dialog ] Go to Layout [ “booking_detail_week_1” (booking_detail_creation) ] Show All Records Exit Script [ ] Else Enter Find Mode [ ] Set Field [ booking_detail::name; "Judith Fahie" ] Set Field [ booking_detail::booking_type; "Holiday" ] Set Field [ approval::time off email sent Yes No; "No" ] Perform Find/Replace [ ] [ No dialog ] Save Records as PDF [ File Name: “file:absence”; Current record ] [ Document - Compatibility: Acrobat 7 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: 100% ] [ Restore; No dialog ] Send Mail [ Send via E-mail Client; To: Personnel Records 2::Email; Subject: "Your Holidays So Far"; Attachment: “file:absence” ] Set Field [ approval::time off email sent Yes No; "Yes" ] #Next Person Enter Find Mode [ ] Set Field [ booking_detail::name; "Mike Butts" ] Set Field [ booking_detail::booking_type; "Holiday" ] Set Field [ approval::time off email sent Yes No; "No" ] Perform Find/Replace [ ] [ No dialog ] Save Records as PDF [ File Name: “file:absence”; Current record ] [ Document - Compatibility: Acrobat 7 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: 100% ] [ Restore; No dialog ] Send Mail [ Send via E-mail Client; To: Personnel Records 2::Email; Subject: "Your Holidays So Far"; Attachment: “file:absence” ] Set Field [ approval::time off email sent Yes No; "Yes" ] #Next Person etc End If End Loop Now what I want to do is not to have to enter each name in the script and have Filemaker find the first name then send mail then the second etc etc. Thanks in advance Scott
bcooney Posted June 1, 2010 Posted June 1, 2010 I believe understanding Go to Related Records will help you. Without trying to completely rewrite your script, when I jump around in a loop, I find it helpful to gtrr New Window, do stuff, then close the window. This keeps me on the record and then I can go Next in the loop. (Of course, that's just style. Returning to a layout always puts you on your last visited record). Also, saving a PDF to the temporary folder ($path ="file:" & Get (TemporaryPath), will help. Avoid Replace and use Set Field (much more multi-user friendly), since you aren't trapping for record lock.
Recommended Posts
This topic is 5288 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