Get the Current Month of the Year

The month of the year can be calculated by using two Formula Language functions@Month and @Select (e.g., January through December).

How It Works

The @Month function returns a numeric value between one and twelve, corresponding to the month of the year. The function returns a numeric one for January and continues through December, which returns a numeric twelve. When combined with the @Select statement, the corresponding text value is stored in the Result.

Implementation

To implement this solution, insert the following formula in an action button, column, or default value for a field. Optionally, replace @Today with a date or field. The @Prompt statement is used for illustrative purposes and can be removed or updated as desired. However, if removed, be sure the formula contains a main expression (i.e., Result) as the last statement in the formula.

Result := @Select(@Month(@Today);
 "January";
 "February";
 "March";
 "April";
 "May";
 "June";
 "July";
 "August";
 "September";
 "October";
 "November";
 "December"
 );
@Prompt([Ok];"Current month"; result);

Figure 14.4 depicts the result when the button is pressed in the month of April.

Figure 14.4. Example month of the year

Note

Using the @Today and @Now functions in column formulas will result in the refresh icon being permanently displayed on the view. Where possible, dates should be stored in a document field that is referenced in the column formula.


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

Calendar Applications

Collaborative Applications

Reference Library Applications

Workflow Applications

Web Applications

Design Enhancements Using LotusScript

Design Enhancements Using Formula Language

View Enhancements

Sample Agents

Miscellaneous Enhancements and Tips for Domino Databases

Data Management

Security

Application Deployment and Maintenance

Troubleshooting

Appendix A. Online Project Files and Sample Applications

Appendix B. IBM® Lotus® Notes® and Domino®Whats Next?



Lotus Notes Developer's Toolbox(c) Tips for Rapid and Successful Deployment
Lotus Notes Developers Toolbox: Tips for Rapid and Successful Deployment
ISBN: 0132214482
EAN: 2147483647
Year: N/A
Pages: 293
Authors: Mark Elliott

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net