Updating documents after redesigning a form

When you redesign a form, be aware of the effect on existing documents. Some form changes, such as formatting changes, automatically display when users open an existing document. Other changes, such as adding a new field, do not affect the contents of existing documents until you update the documents manually or by running an agent.

For example, if you add a new combobox field, "Status", with default value "Draft," then create a new document, the Status field will contain a value. However, documents last edited with the previous version of the form, do not contain this field. If you open one of these documents, it appears to have the default value "Draft," because when you open a document, Notes® calculates the default/value formulas for all fields that don't already have values. However, if you close the document without putting it in edit mode and saving it, the document is unchanged and still doesn't contain the field.

To see the difference, use the fields tab of the Document Properties dialog, or create a view with a column displaying the new field. New documents show a value in the column; for old documents it is blank.

In some cases, this might not make a difference for your application. If you do want to assign the fields in old documents to the default value (or to some other value) you could write an agent to do it. For the previous example, a formula agent that executes on all documents in the database, might have the following formula:

SELECT Form = "formname" & @IsUnavailable(Status);
FIELD Status := "Published"

In this case, the status for a pre-existing document was "Published", reflecting its status as a legacy document, not the default "Draft" that would be used for a new document.

If you want to set all new fields to their default values, you could use the formulas @Command() or @Command(). You could put this in a toolbar button, for easy use. This is not a good idea in all cases, however; read the documentation of these functions before you use them.

Form changes that don't require updates to existing documents

As long as the form doesn't have the "Store form in documents" property set, changes in the following form elements display automatically in existing documents. When users open a document, they see the changed format.

  • Computed field formulas
  • Static text on the forms
  • Pop-ups
  • Text properties and formats
  • Form actions and buttons
  • Graphics
  • Form names if you leave the original name as a synonym following the vertical bar (|) symbol.

Form changes that require updates to existing documents

  • New fields
  • Field data types
  • Field names
  • Deleted fields
  • Form names if you don't leave the original name as a synonym.
  • Form types -- for example, from Main to Response
  • Forms with the property "Store form in document"