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

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

Recommended Posts

  • Newbies
Posted

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?

Posted

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

  • Newbies
Posted

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

  • Newbies
Posted

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

This topic is 5337 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.