Allowing users to set colors in a view
About this task
Domino® 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 Domino® 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.
Procedure
Results
For information on creating a profile form, see "Creating a profile form."
- 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". The programmatic
name can be text, but user-defined column functionality will not work
unless the name begins with an "$."Note: If you want the user to be able to set both a text color and a highlight color, you will need two color fields, and the $3 field will need to combine the two colors.
For information on creating a color field, see Color fields. For information on the programmatic name for a column, see Adding programming to columns.
- Select the view column you want to make customizable and choose Design - Column properties.
- On the Column Info tab, check "Use value as color" and "User defined."
- In the field next to "User defined," enter the name of the profile form.
- 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
About this task
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.