April 15, 201015 yr 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?
April 15, 201015 yr Please show your script with the "If" test included - we don't what you are testing against.
April 15, 201015 yr 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
April 15, 201015 yr The ≠ operator is not case-sensitive: "a" ≠ "A" returns False. Use the Exact() function instead.
April 15, 201015 yr 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
Create an account or sign in to comment