Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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

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

  • Author

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

what error does it give you?  The fms log should tell you what it is on what script step.

  • Author

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.