Manage Learn to apply best practices and optimize your operations.

Checking that a name is in the address book

If you use editable Name field and you want to ensure that the name entered is listed in your address book...

If you use editable Name field (or author/reader) and you want to ensure that the name entered is listed in your address book, put this code in the validation formula of your field.

- This allows you to specifically define which Directory you want to look in... In my example I am looking at the names.nsf database at the root of the user server...
- This works only for single value field.

@If( @Name([O]; YOURFIELD) != "" ; @Return(YOURFIELD) ;
YOURFIELD ="" ; @Return("") ; "");

result :=@DbLookup("" ; @Subset(@MailDbName;1) : "names.nsf" ; "($Users)" ;
YOURFIELD ; "FullName" );

@If( @IsError(result) ;@Do( @Prompt([OK];"Erreur";"Unable to find the name in the adress book"); @Return(""));
@Elements(result)=1;@Return(result); "") ;

REM " C'est pas fini !";
result2:= @Replace(@Name([O];result ) ; "" ; "");
result3 := @Trim(@Replace(result; result+result2 ; "" ));

@If(@Elements(result3) = 1 ;@Return(result3) ;"" );

@Prompt ([OKCANCELLIST];"Homonyms" ; "Several names are matching" ;
@Subset(result3;1) ;result3 )

Dig Deeper on Lotus Domino Directory

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.



  • iSeries tutorials'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 ...