CNS Plug-ins

Track Field Changes

###Set up the database for tracking field changes

This section explains the steps necessary to set up each Table in the database for auditing. After completing these steps, the plug-in will be able to track the changes to field values in the database. (Note: You may also want to implement the validation options described in the Preventing database modification if CNS Audit is not present subsection of the Optional Set Up Tasks section at this time.) If your solution consists of multiple files, you will also need to follow the instructions in the Setting up Multiple Files / Data Separation Model section.

  1. Open the Database file and go to Define / Manage Database.
  2. Switch to the Fields tab and select the first table from the Table drop-down menu in which auditing needs to be added.
  1. Add a new Timestamp field named CNS Audit Timestamp. Make sure the field is named *CNS Audit Timestamp* exactly.
  2. Press Options for the CNS Audit Timestamp field.
  3. In the Options for Field dialog that pops-up, switch to the Auto-Enter tab, and check the Modification Timestamp option.
  1. Optional: Set up the Validation options as described in the Preventing database modification if CNS Audit is not present subsection of the Optional Set Up Tasks section.
  2. Press OK to close the Options for Field dialog.
  3. Add a new Text field named CNS Audit Trigger. Make sure the field is named CNS Audit Trigger exactly.
  1. Press Options for the CNS Audit Trigger field.
  2. In the Options for Field dialog that pops-up, switch to the Auto-Enter tab, and check the Calculated Value option.
  1. In the Specify Calculation dialog that pops up, change the View drop-down to External Functions.
  1. In the list of functions, scroll down until a line for CNSAudit_RecordChange is visible and double-click it.
  2. Press OK to close the Specify Calculation dialog.
  1. Back on the Options for Field dialog, uncheck the Do not replace existing value of field (if any) option.
  2. Press OK to close the Options for Field dialog.
  3. Repeat steps 3-15 for each table that needs auditing. (If using FileMaker Pro Advanced, highlight the two fields, press Copy, and then go to each table and press Paste.)
  4. Close the Define / Manage Database dialog.