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

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

Recommended Posts

Posted

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
Posted

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
Posted

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.

Posted

Huh?

 

I don't see OnObjectValidate firing unless a validation rule is defined in the Require section.

Posted

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). :-)

Posted

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.

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