Forum Discussion
MarkShnier__You
Qrew Legend
5 years agonp, here is what I suggest.
make a field called [Warnings]
var text Warnings =
List( "<br>",
If( begins($email," "), "Leading space character" ),
If( ends ($email," "), "Trailing space character" ),
If( not Contains($email,"@"), "Missing @ symbol" ),
If( not Contains(Part($email, 2, "@" ),"."), "Missing .com or similar at the end" ),
If( Contains($email, " "), "Has a space inside the email address" ),
//If(Part($email, 1,"<>[]{},")<>"", "Bad characters in in the email address"),
If(Part($email, 2,"<>[]{},")<>"", "Bad characters in in the email address"),
If(Begins($email,"<"), "Bad characters in email address"),
If(Ends($email,">"), "Bad characters in email address"),
If(Contains($email, "mailto"), "Bad email address"),
If(Contains($email, ":"), "Bad email address" ),
If(Ends($email, "."), "email ends in a period - that can't be right" ),
If(contains($email, ")"), "email contains a bracket ( or ) - that can't be right" )
));
If($Warning<>"", "<font color=red>" & $Warning)
The for your button you do this
var text Button =
URLRoot() &"DB/"& Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=XXXX_fid_92=TRUE" & "&apptoken=XXXX_fid_43=" & (Today()) & "&rdr=" & URLEncode(URLRoot() & "db/" &[_DBID_QUOTES] &"?a=dr&rid=" &[Record ID#]);
If([Warnings]="", $Button)
The effect of this is that you will have a warning field that you can put on reports and forms and also if there are warnings that will make the button go blank and your users will have nothing to click on.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
make a field called [Warnings]
var text Warnings =
List( "<br>",
If( begins($email," "), "Leading space character" ),
If( ends ($email," "), "Trailing space character" ),
If( not Contains($email,"@"), "Missing @ symbol" ),
If( not Contains(Part($email, 2, "@" ),"."), "Missing .com or similar at the end" ),
If( Contains($email, " "), "Has a space inside the email address" ),
//If(Part($email, 1,"<>[]{},")<>"", "Bad characters in in the email address"),
If(Part($email, 2,"<>[]{},")<>"", "Bad characters in in the email address"),
If(Begins($email,"<"), "Bad characters in email address"),
If(Ends($email,">"), "Bad characters in email address"),
If(Contains($email, "mailto"), "Bad email address"),
If(Contains($email, ":"), "Bad email address" ),
If(Ends($email, "."), "email ends in a period - that can't be right" ),
If(contains($email, ")"), "email contains a bracket ( or ) - that can't be right" )
));
If($Warning<>"", "<font color=red>" & $Warning)
The for your button you do this
var text Button =
URLRoot() &"DB/"& Dbid() & "?a=API_EditRecord&rid=" & [Record ID#] & "&apptoken=XXXX_fid_92=TRUE" & "&apptoken=XXXX_fid_43=" & (Today()) & "&rdr=" & URLEncode(URLRoot() & "db/" &[_DBID_QUOTES] &"?a=dr&rid=" &[Record ID#]);
If([Warnings]="", $Button)
The effect of this is that you will have a warning field that you can put on reports and forms and also if there are warnings that will make the button go blank and your users will have nothing to click on.
------------------------------
Mark Shnier (YQC)
Quick Base Solution Provider
Your Quick Base Coach
http://QuickBaseCoach.com
mark.shnier@gmail.com
------------------------------
- KimG5 years agoQrew CadetThanks Mark! I will give that a try. I think I could use that concept in a few other places as well. I appreciate the new ideas and sample code.
------------------------------
Kim Gardner
------------------------------