Skip 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.

How to stop layout switch in a script?

Featured Replies

Hello!

I'm new in scripting but trying to stop current layout from the switch to other one by the script that:

1. Verifies 2 arguments Exit 1 and Exit 2 (the sum must be less or equal then 100).

2. If 2 fields are <= 100, the user should not be able to exit the layout and be returned to the original one (selected field).

I've wrote the script:

If [Exit Strategy::Last Exit = "Error!"]

Beep

Show Custom Dialog ["Error!"; "The sum must be <= 100"; Exit strategy::Exit 1; Exit Stratagy::Exit 2]

If [Get (LastMessageChoice) = 1]

If [Exit Strategy::Exit 1 + Exit strategy::Exit 2 <= 100]

Go to Layout ["Exit Strategy)]

Go to Field [Exit strategy::Exit 1]

End If

End If

End If

When I verify the sum of Exit 1 and Exit 2 fields within the layout it's OK. But when I switch to other layouts, I can't force the script to stay in current layout till the sum of the fields is validated.

I'm sure I miss something.

Help please.

Serge

Is this script attached to a "Go To Some Other Layout" button? If so,

If [Exit Strategy::Last Exit = "Error!"]

Beep

Show Custom Dialog ["Error!"; "The sum must be <= 100"; Exit strategy::Exit 1; Exit Stratagy::Exit 2]

If [Get (LastMessageChoice) = 1]

.....If [Exit Strategy::Exit 1 + Exit strategy::Exit 2 <= 100]

..........Go to Layout ["Exit Strategy]

..........Go to Field [Exit strategy::Exit 1]

.....Else

..........Go to Layout["Other Layout"]

.....End If

End If

End If

In other words, only allow the script to change the layout, not some other mechanism.

  • Author

Hello, doughemi

and thanks for the reply.

No, the script is not attached to the button. I just tried to switch the layout by selecting it in taskbar ("Layout:" with droplist).

Still does not work.

Kind regards,

Serge

There isn't any way that I know of to override layout selection from the taskbar. This is one reason why many solutions hide the taskbar and only allow users to navigate by buttons, tabs, and scripts.

There isn't any way that I know of to override layout selection from the taskbar.

How about a script triggered OnLayoutExit?

@Serge:

Your question is not clear. You cannot leave the current record without committing it first - and you cannot commit a record if it doesn't pass validation (unless you choose to do so explicitly in the script).

---

P.S. Please update your profile to state your version.

Edited by comment

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.