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.

Having difficulty with Object Script Triggers

Featured Replies

  • Newbies

I am coming up against a brick wall.

If I add the following as an OnObjectExit trigger, it all works fine, but the moment that I enter an 'If' test before, so that it will only raise the Custom Dialogue Box if a condition is met, then nothing happens. It's driving me mad!

Show Custom Dialog [ Title: "Do you mean?"; Message: "Do you mean "

&

Let

(

Cleaned =

Substitute

( Proper

( Trim

( Substitute

(

Get ( ActiveFieldContents ); ["Mac" ; "Mac " ]; ["mac" ; "Mac "]; ["Mc" ; "Mc "]; ["mc" ; "Mc "]

)

)

)

; ["De " ; "de "]; [" De " ; " de "]

)

;

Substitute ( Cleaned ; ["Mac " ; "Mac" ]; ["Mc " ; "Mc"] )

)

&

"?"; Buttons: “Yes”, “No” ]

If [ Get ( LastMessageChoice ) = 1 ]

Set Field [ Pupil::Contact Primary Name Last; Let

(

Cleaned =

Substitute

( Proper

( Trim

( Substitute

(

Get ( ActiveFieldContents ); ["Mac" ; "Mac " ]; ["mac" ; "Mac "]; ["Mc" ; "Mc "]; ["mc" ; "Mc "]

)

)

)

; ["De " ; "de "]; [" De " ; " de "]

)

;

Substitute ( Cleaned ; ["Mac " ; "Mac" ]; ["Mc " ; "Mc"] )

) ]

Else

Go to Next Field

End If

Anyone any ideas?

Please show your script with the "If" test included - we don't what you are testing against.

  • Author
  • Newbies

Thanks for the quick response. I should have shown the 'If' statement in my original post. I have since tried it with all sorts of variations and the only time the Dialogue Box shows is without any 'If' statements of any kind (as in the original post).

The script that I would like to run is as follows (I have stripped some of the substitutions to reduce the length of the post):

If [ Get ( ActiveFieldContents ) ≠

Let

(

Cleaned =

Substitute

( Proper

( Trim

( Substitute

(

Get ( ActiveFieldContents ); ["Mac" ; "Mac " ]; ["mac" ; "Mac "]; ["Mc" ; "Mc "]; ["mc" ; "Mc "]

)

)

)

; ["De " ; "de "]; [" De " ; " de "]

)

;

Substitute ( Cleaned ; ["Mac " ; "Mac" ]; ["Mc " ; "Mc"] )

) ]

Show Custom Dialog [ Title: "Do you mean?"; Message: "Do you mean "

&

Let

(

Cleaned =

Substitute

( Proper

( Trim

( Substitute

(

Get ( ActiveFieldContents ); ["Mac" ; "Mac " ]; ["mac" ; "Mac "]; ["Mc" ; "Mc "]; ["mc" ; "Mc "]

)

)

)

; ["De " ; "de "]; [" De " ; " de "]

)

;

Substitute ( Cleaned ; ["Mac " ; "Mac" ]; ["Mc " ; "Mc"] )

)

&

"?"; Buttons: “Yes”, “No” ]

If [ Get ( LastMessageChoice ) = 1 ]

Set Field [ Pupil::Contact Primary Name Last; Let

(

Cleaned =

Substitute

( Proper

( Trim

( Substitute

(

Get ( ActiveFieldContents ); ["Mac" ; "Mac " ]; ["mac" ; "Mac "]; ["Mc" ; "Mc "]; ["mc" ; "Mc "]

)

)

)

; ["De " ; "de "]; [" De " ; " de "]

)

;

Substitute ( Cleaned ; ["Mac " ; "Mac" ]; ["Mc " ; "Mc"] )

) ]

Else

Go to Next Field

End If

Else

Go to Next Field

End If

Once again, thanks for looking at this.

efpw

The ≠ operator is not case-sensitive:

"a" ≠ "A"

returns False. Use the Exact() function instead.

  • Author
  • Newbies

Genius!

So, whoever you are, and where-ever you are: a thousand 'thank you's. I have wasted so much time testing and re-testing with different values but that was the one that I didn't doubt!

The solution is so simple (to you), but to the inexperienced (me), unbelievably time-wasting!

Thank you (1001)

efpw

We've all been there... :

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.