Creating Shared Fields
Shared fields are useful when you anticipate using the same field on multiple forms. When you share a field, it shares the properties and the formulas for the field, not just the data. Generally, shared fields are used when the field has a complicated formula and it will be used (shared) in multiple forms. You can add a shared field to a form or subform from the Design menu, or you can turn a field that has already been created into a shared field. In Designer 6, you can add a shared field to a database using the New Shared Field button in the Designer IDE, as shown in Figure 7.16.
Figure 7.16. Creating a new shared field in a Domino 6 database.
After the shared field has been added to the database and is listed in the Work pane, it can be inserted into a form or subform by choosing Create, Resource, Insert Shared Field on the menu bar, as shown in Figure 7.17.
Figure 7.17. How to create a new shared field in a Domino 6 database.
To create a shared field from an existing field on a form, using the Design menu, select Share This Field from the menu bar. Open the properties box for the field to define the field's properties. You assign a formula to the appropriate event as you normally would for a regular single-use field; the only difference when using a shared field is that the Design pane does not appear in the IDE because you are not working in a form (see Figure 7.18).
Figure 7.18. The shared field design looks similar to the design of a single-use field, except that a shared field has a thicker border around the perimeter of the field.
Shared fields can be renamed , with all instances of the field's name updated in all forms to reflect the name change. Shared fields also can be deleted, copied , accessed on the back end through LotusScript, created using @Command([DesignSharedFields]) , used in multilingual databases to support different languages, or converted to or from a single-use field. Shared fields often also help to reduce code maintenance in a database. A shared field can be any field type as a single-use field, such as Text, Computed for Display, Computed, and so on.