How to substitute an attached record with another record

The Global Replace tool can be used to attach a record to one or more records or replace an existing attachment with another record.

In this example, many parties (recorded in the Parties module) have an association with Party A (also recorded in the Parties module). The attachment is made using the Party: (Associated With) field:

If the association changes, to Party B for instance, it is a simple matter to search for all affected records and replace the attachment to Party A with an attachment to Party B:

  1. Search for or otherwise list a group of records that need to be changed.
  2. Select Edit>Replace from the Menu bar.

    The Replace box displays with a list of substitutions defined for the current session, if any.

    Note: Note that the Replace box works differently to other dialog boxes: all substitutions defined in the current session and displaying in the Replace box will be run when either Replace or Replace All is clicked. It is not possible to select just one substitution from the list to run. In the above example, even though the Department substitution is highlighted, both substitutions listed will be run when Replace or Replace All is clicked.
    Before adding a new substitution you may wish to remove substitutions that are no longer required.

  3. Click New to define a new substitution. The Substitution box displays:

    Global Replace dialogue box

  4. From the Field drop list select the field with the attachment to be replaced, e.g. Party: (Associated With).

    The field's data type (Integer) automatically displays in the Type field: attachment fields store the IRN (an integer) of the attached record.

  5. Click Add Attach beside the Text to find field.

    The module attached to the field selected at Step 4 displays in Search mode; in this example the Parties module displays and is labelled Parties (2).

  6. Search for and select the record to be replaced, e.g. the Party A record.
  7. Click Add Attach in the Parties (2) module Tool bar.

    The IRN of the record is copied into the Text to find field. Vitalware automatically ticks the Regular expression checkbox and places a carrot (^) before and a dollar sign ($) after the IRN to indicate that this is a wildcard search string.

  8. In the Substitution box, click Add Attach beside the Replace with field.

    The module attached to this field opens; in this example the Parties module displays and is labelled Parties (2).

  9. Search for and select the replacement record, e.g. the Party B record.
  10. Click Add Attach in the Parties (2) module Tool bar.

    The IRN of the record is copied into the Replace with field:

    Global Replacement: Attachment

  11. Click OK.

    The Substitution box closes and the new substitution displays in the Replace box.

    Note: Note that the Replace box works differently to other dialog boxes: all substitutions defined in the current session and displaying in the Replace box will be run when either Replace or Replace All is clicked. It is not possible to select just one substitution from the list to run.

  12. To run the substitution, click Replace All to make the substitution in all records returned by the search (at Step 1)

    -OR-

    Click Replace to make the substitution within the current record or selected records only.

    The progress of the replacement displays in a box that includes an option to abort.

    When the substitution is complete:

    1. The Abort button is replaced with an OK button
    2. The numbers of records processed and modified are displayed.
  13. Click OK to close the Replace progress box.