Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3137 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (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 by Joost Miltenburg
clarification
Posted (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 by Kris M
Posted

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

Posted (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 by Joost Miltenburg

This topic is 3137 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.