April 10, 201411 yr I have attached the below script as an OnObjectTrigger to a field for storing email addresses. The logic works correctly. However, when exiting the field to go to another, even then it exits true, the active field will not change to the next one I tried to put focus on. The field does not have validation on it at the define database level. Any ideas? If [ Let([content = Get ( ActiveFieldContents )]; If(IsEmpty ( content ) or IsValidEmailFormat ( content ) ; 1 ; 0)) ] Exit Script [Result: "True"] Else Show Custom Dialog ["Invalid Email" ; "You have entered an invalid email. Fix it, or remove it."] Exit Script [Result: "False"] End If
April 11, 201411 yr Your title mentions '…OnObjectValidate …" (though that it not a script step), but then you say that there is no validation at the field level. If no validation is set, then OnValidate won't fire. Using this (briefer) script with OnObjectExit works for me – the focus either remains in the field, or it goes to the next field as per Tab Order. If [ Let ( content = Get ( ActiveFieldContents ) ; not ( IsEmpty ( content ) or IsValidEmailFormat ( content ) ) ) ] Show Custom Dialog [ Title: title; Message: message ] Exit Script [ Result: False ] End If
April 11, 201411 yr when exiting the field to go to another, even then it exits true, the active field will not change to the next one I tried to put focus on. I cannot reproduce your issue. Are you sure there isn't something else at play here? --- Hold on, I got it: Exit Script [Result: "True"] This needs to be: Exit Script [Result: True] without the quotes. Actually, you don't need this part at all. The important part is where you exit with a False result - which also should be without quotes, or just use 0.
April 11, 201411 yr Huh? I don't see OnObjectValidate firing unless a validation rule is defined in the Require section.
April 11, 201411 yr Wow, that's not my experience. OnObjectVaidate does require that something change in the field to fire - just entering and exiting the field won't fire it but otherwise it fires for me (Maverick also). :-)
April 11, 201411 yr Wow, that's not my experience. OnObjectVaidate does require that something change in the field to fire - just entering and exiting the field won't fire it but otherwise it fires for me (Maverick also). :-) I overlooked the requirement of the content change ; thanks for clarifying that.
April 14, 201411 yr Author OnObject what? Enter, keystroke, modify, validate, save or exit? Sorry about that... ughhh kind of a big difference
Create an account or sign in to comment