Joost Miltenburg Posted April 21, 2016 Posted April 21, 2016 (edited) LS, I am running FM script below as a schedule. The script runs fine in this form. On FMserver it gives me an error. I am probably overlooking something to easy... Regards, Joost --- Set Error Capture [ On ] Allow User Abort [ Off ] Go to Layout [ “Entry” (CONTACT) ] Enter Find Mode [] Set Field [ CONTACT::contactnr ; "<100" ] Perform Find [] If [ Get (FoundCount) > 0] Send Mail [ Send via SMTP Server ; No dialog ; " ] Else Exit Script [ Result: 0 ] End If Edited April 21, 2016 by Joost Miltenburg clarification
Kris M Posted April 21, 2016 Posted April 21, 2016 (edited) 1=1 always evalutes to true so whats the point? Please explain what fails if you leave out the or 1=1 part. Edited April 21, 2016 by Kris M
Joost Miltenburg Posted April 21, 2016 Author Posted April 21, 2016 I know... the point is... when I remove it, the script apparently fails ( or so says FMserver ). I am looking for the answer to the question why it fails on FMserver when the 1=1 is gone. I edited the question
Wim Decorte Posted April 21, 2016 Posted April 21, 2016 what error does it give you? The fms log should tell you what it is on what script step.
Joost Miltenburg Posted April 21, 2016 Author Posted April 21, 2016 (edited) error 401... Figures as I don't want to find records with these values. Don't ask... So I changed the script to : Set Error Capture [ On ] Allow User Abort [ Off ] Go to Layout [ “Entry” (CONTACT) ] Enter Find Mode [] Set Field [ CONTACT::contactnr ; "<100" ] Perform Find [] Set Variable [ $lastError ; Value: Get (LastError) ] If [ Get (LastError) = 0 ] Send Mail [ Send via SMTP Server ; No dialog ; " ] Else If [ Get (LastError) = 401 ] Exit Script [ Result: $lastError ] End If Runs fine.... Question : Set Error Capture [ On ] should have taken care of this in my previous version. Shouldn't it ? Edited April 21, 2016 by Joost Miltenburg
Recommended Posts
This topic is 3411 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