Manage Learn to apply best practices and optimize your operations.

Reorder CommonName of User Name

This tip describes how to reorder CommonName of User Name.

This tip was submitted to the SearchDomino.com tip library by member Michael Kinder. Please let others know how useful it is via the rating scale at the end of the tip. Do you have a useful Lotus Notes, Domino, Workplace or WebSphere tip or code snippet to share? Submit it to our monthly tip contest and you could win a prize.


VIEW MEMBER FEEDACK TO THIS TIP

The code below can be used in view columns or wherever else you may need to reorder the CommonName portion of a UserName. For example, you may want to put the name LastName , FirstName MiddleInitial(if it exists). Or you could change it around any way necessary.

rs := @ReplaceSubstring(@Name
([CN]; NotesName); " "; ";");

exp := @Explode(rs; ";"; 0);

ele := @Elements(exp);

@If(ele=3; @Subset(exp; -1) + " , "
 + @Subset(exp; 1) + " " + 
@Subset(@Subset(exp; 2); -1); 
@Subset(exp; -1) + " , " + @Subset(exp; 1))
  

MEMBER FEEDBACK TO THIS TIP

Michael Kinder's four-step solution to reversing first and last names can be simplified. However, neither his method nor the above below handles suffixes, such a Jr. or III. Here's how to do it:

  
 fullname := @Name ([CN]; @UserName);
 lastname := @RightBack (fullname; " "); 
firstname := @Left (fullname; lastname); 
@Trim (lastname + "; " + firstname)

—David P.

Do you have comments on this tip? Let us know.

Dig Deeper on Lotus Notes Domino Formula Language

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

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

SearchDataCenter

SearchContentManagement

Close