APPLICATION DESIGN


Allowing users to set colors in a view
IBMR LotusR Domino(TM) Designer allows you to set the color for a column programmatically to visually differentiate documents in a view. You can use this functionality to provide users with the means to set the color for documents in a view. This feature can be extended to allow users to determine the colors for a column by means of a generic profile -- a particular type of form -- to set values in a database. For example, in the IBMR LotusR Domino(TM) Release 6 mail template (mail6.ntf) you can choose Tools -- Preferences, click the Colors tab and associate colors with different senders to customize how mail displays in your Inbox.

Note Because it relies on a generic, rather than a user-specific profile form, the feature is only useful for a database with only one user, such as a mail database or a personal journal.

1. Create a profile form in the database that creates one profile for the database. Make sure you create a button, action, or agent that users can run to create the profile document.

2. Create two fields on the profile form. The first will be a color field that users will use to select a color. The second field will be a formula field set to hold either the value of the color field, or a formula that evaluates to a color. The formula field must have the same name as the programmatic name for the column in the view. For example, if the column's programmatic name is "$3", then the formula field on the profile form must also be "$3".


For information on creating a color field, see Color fields. For information on the programmatic name for a column, see Adding programming to columns.

3. Select the view column you want to make customizable and choose Design - Column properties.

4. On the Column Info tab, check "Use value as color" and "User defined."

5. In the field next to "User defined," enter the name of the profile form.

6. In the programming pane, choose "Formula" as the column value and enter a valid formula, such as @UserName, as the column formula. This formula must return a non-constant, with no special text characters.

Setting the color value in the profile document

To specify a color for a column, the user must create a profile document without a user name. Since this special type of form cannot be created using the Create menu, you must supply a button, action, or agent the user can use to create the document. When the document is created, the user sees a color picker for the specified column.

For information on creating and editing a profile document, see Profile forms.