All-in-One Notes Formula Validation for Client or Web

This validation formula will check all designated fields when saved or submitted and display a message based on the client type (Notes or Web).


REM "Check the fields for incorrect or missing values" ;
var1 := @If( FName = "" ; "First Name" ; NULL ) ;
var2 := @If( LName = "" ; "Last Name" ; NULL ) ;
var3 := @If( EMail = "" ; "Email Address" ; NULL ) ;
var4 := @If( (@ValidateInternetAddress([Address821] ; Email ) != NULL) & var3 = NULL ; "Email Address Format" ; NULL ) ;
REM "Build Return String" ;
varStr1 := @Trim(var1:var2:var3:var4 ) ;
varStr2 := "The following values are missing or incorrect:":varStr1 ; REM "Validation" ;
@If( (@ClientType != "Notes") & (varStr1 != NULL) ; @Failure("<script>alert("" + @Implode(varStr2 ; "n") +""); history.back()</script>");
(@ClientType = "Notes") & (varStr1 != NULL) ; @Prompt([OK] ; "MISSING OR INCORRECT VALUES" ; ( @Implode(varStr2 ; @char(10) ) ) ) ; @Success )

This was first published in March 2001
This Content Component encountered an error

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close