Working with @DBColumn

The @DBColumn function can be used to dynamically populate a field with values. In other words, the options displayed in a radio button, checkbox, listbox, prompt, or other design element can be dynamically managed without having to change the design of the database.

How It Works

When using the @DBColumn function, all values from a particular view column are returned to the routine. For example, let's say you have an action item database, and one view contains a separate document for each person in the department. As each new team member arrives, a person document is created. As team members migrate to other departments or projects, their documents are removed. Using the @DBColumn function, you can dynamically assign new tasks to team members represented by person documents (see Figure 14.14).

Figure 14.14. Using @DBColumn to provide values for a checkbox field

 

Implementation

Step 1.

Determine (or create) the view and column that contain the values to be utilized by the field. Make note of the view name and column number. These design elements can be hidden or displayed. If the column is not the first in the view, be sure to accurately count the column number.
 

Step 2.

Create a field and select the field type as desired (such as radio button, combobox, checkbox, or listbox) in tab 1 of the properties dialog. In tab 2, change the Choices option to Use formula for choices and insert the following formula in the dialog box. Be sure to change the formula to include the actual view name and desired column number. Close the properties dialog when finished.
 

Class :="";
Cache := "NoCache";
Host := "";
Viewname := "VIEW";
Column := 1;
result := @Unique(@DbColumn(Class : Cache; Host; Viewname ; Column));
@Sort (result; [Ascending]);
 

Tip

Use the @Sort function to display results in ascending or descending order. An example of this function is covered later in this chapter.



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