Using the "Input Translation" event, you can format the data for a particular field as the form is being created or updated. This event is particularly handy for ensuring a consistent data format or naming nomenclature. For example, this event can be used to ensure that all text is translated to uppercase, that extraneous spaces are removed from text, or that a telephone number is formatted with hyphens.
How It Works
The "Input Translation" event is located in the Programmer's pane for most editable fields. This event is not present for computed fields or Rich Text fields. Field translation occurs based on a specified formula when the document is saved or refreshed. Some of the common Formula Language functions used to translate data values include @trim, @UpperCase, @LowerCase, and @ProperCase.
To implement this solution, insert a formula in the field's Input Translation event. The following illustrate some of the field translation formulas.
The @TRim function removes extraneous leading, trailing, and embedded spaces from the string.
@Trim ( FIELDNAME )
The @Uppercase function changes the string to all uppercase.
@UpperCase ( FIELDNAME )
The @ProperCase function changes the string such that the first character of each word is capitalized.
@ProperCase ( FIELDNAME )
The @LowerCase function changes the string to all lowercase letters.
@LowerCase ( FIELDNAME )
If you're looking for additional Input Translation samples, check out the Lotus Notes discussion forums at http://www-10.lotus.com/ldd/46dom.nsf/ or http://www-10.lotus.com/ldd/nd6forum.nsf. For example, if you're looking to format a telephone number, you could search these databases. A good example can be found in the 46dom.nsf database. Simply search for "Validation Code for a Phone Number field" or "Phone Number". Be sure to include quotes to narrow down the results.
An Introduction to the Lotus Domino Tool Suite
Getting Started with Designer
Navigating the Domino Designer Workspace
Domino Design Elements
An Introduction to Formula Language
An Introduction to LotusScript
Fundamentals of a Notes Application
Reference Library Applications
Design Enhancements Using LotusScript
Design Enhancements Using Formula Language
Miscellaneous Enhancements and Tips for Domino Databases
Application Deployment and Maintenance
Appendix A. Online Project Files and Sample Applications
Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?