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.

Re-Login and error capture

Featured Replies

Using the re-login step seems not to return the correct error messages. When I test the below script if I cancel the script it sets last error to 1 and the script works as expected, however if I type a non valid account name, without password the last error is set to 0. I would have expected an error 213, which would have looped back to the re-login till the max login attempts were reached or a successful login was completed. As I see it with error capture on relogin does not set the proper error number.

Am I not understanding something here or is the another bug?

Script Example:

Adjust Window

[ Hide ]

Set Error Capture [ On ]

Loop

Re-Login [ ]

If [ Get ( LastError ) = 1 or Get ( LastError ) = 214 ]

Exit Application

End If

Exit Loop If [ Get ( LastError ) = 0 ]

End Loop

Set Error Capture [ Off ]

Perform Script [ "Startup" ]

Background:

I want the application to log out the current user and perform the startup script upon sucessfull re login.

If I do:

Re-Login [ ]

Perform Script [ "Startup" ]

and the user cancels the login, the current user and associated priveleges are still active so it re-starts with the last users info. So they were not logged out. So thats when I tried the capture script.

Bottom line I want to be able to log out the current user without quitting the application.

Rod

Try this:

Put up a custom dialog to mimic the login one, then pass the entered data to the relogin script.

It could be that the relogin script only properly returns an error if credentials are supplied trough a script, not if the user types them in.

  • Author

Wim, no luck, acts the same using re-login without the dialog, looks like there is a problem with relogin.

Rod

Put the last error into a global right after the Re-Login, then use that global in tests for branching.

  • Author

Ender, no good, same as my testing the last error with If it returns a 0 to last error, this must be a bug, can anyone confirm my findings or definitly say it works ok for them I'm on V3.

Rod

It works fine for me, but only if I use the global:

...

Re-Login [ ]

Set Field [ gError ; Get ( LastError ) ]

If [ gError = 1 or gError = 214 ]

Exit Application

End If

Exit Loop If [ gError = 0 ]

End Loop

...

A quick test on my end gives an error # 212 when I input a non-valid account and blank password. I think you may be generating your LastError = 0 from successful completion of the If statement, which would also be why Ender's use of a Global fixes it.

-Terence

  • Author

Ender, Murphy, sorry for late response, I was away. The trap with global was in fact working when I first tried it, I was checking the wrong field (in my haste to get this done). Thanks for confirming for me.

Rod

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.