October 19, 20205 yr Hi all, I would like to create a script or function for the Email field in case the entry of the email without @ give him an error or an invalid address. thanks a lot for any help or support
October 19, 20205 yr You could do a trigger OnObjectSave. The script would use this custom function https://www.briandunning.com/cf/360 and show a dialog. You could just use this part of the CF: Left ( yourEmailField ; Position ( yourEmailField ; "@" ; 1; 1 ) - 1 ) ; Or, you could really go for it and use SendGrid's API to validate the email is real. https://sendgrid.com/docs/api-reference/ Email Address Validation.
October 20, 20205 yr Author Actual I created function but while filling the field correct e-mail give me No. 1 instead of e-mail. the result
October 20, 20205 yr I suggest you start with something simple: validate the email field using a calculation = PatternCount ( Self ; "@" ) This will produce a validation error when you try to commit a record where the email field does not contain the @ character. Now, this simple solution has several flaws: It fires on record commit, not when user exits the field; The error message can be cryptic and confusing to the user; There are many other ways in which an email address can be invalid. To solve the first two problems, you can attach an OnObjectValidate script trigger to the field and have it run a script along the lines of: If [ not PatternCount ( YourTable::Email ; "@" ) ] Show Custom Dialog [ "The email is not valid." ] Exit Script [ Result: False ] End If IMPORTANT Script triggers work only on layouts where they have been installed. If you want to ensure data integrity, use the script trigger in addition to field validation, not instead of it. The third problem is much more complicated and I won't go into it now. Edited October 20, 20205 yr by comment
October 20, 20205 yr Author I created as per mentioned but unfortunately still if e-mail correct given me No. 1
October 20, 20205 yr Apparently you are creating a new calculation field, instead of validating the existing email field: https://help.claris.com/en/pro-help/index.html#page/FMP_Help%2Ffield-validation.html%23
October 20, 20205 yr Author Your are super FM is working fine in future I will update Please I hope to visit this link :
Create an account or sign in to comment