OpenNTF.org - Sort months by name (@Sort for
    Advanced
   OpenNTF Code Bin
Edit Document Code By Date > Code Document
About This Code
Brief Description:
Sort months by name (@Sort formula example) 
Rating:
Rating: 4 , Number of votes: 1 
Contributor:
John Smart 
Category:
Lotus Formula 
Type:
String functions 
Document Release:
Notes Version:
R8.x, R7.x 
Last Modified:
20 Feb 2008 
OpenNTF Disclaimer

All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.

Code / Description
asMonths := "January":"February":"March":"April":"May":"June":"July":"August":"September":"October":"November":"December";

@If(
@IsDocBeingSaved | @IsDocBeingMailed;
@Sort(@ThisValue; [CustomSort]; @Member($A; asMonths) > @Member($B; asMonths));
@ThisValue)

Usage / Example
If you have a multi-value keyword field that contains months, you can use this as the translation formula to guarantee that months are sorted in correct order regardless of how the user entered them.
 Comments

No documents found

 Add your comment!