CNS Plug-ins

Startup and Shutdown

###Set up the database for startup and shutdown

This section explains how to add or modify the Startup and Shutdown scripts for the database for setting up CNS Audit for the file. While this is optional for single-file solutions, by following these instructions, CNS Audit will function better with the database. If your solution consists of multiple files, you will be required to add at least a Startup script and follow the instructions in the Setting up Multiple Files / Data Separation Model section.

  1. Open up the ScriptMaker / Manage Scripts dialog.
  2. Create a script named Startup (or something similar) or edit an existing Startup script if one is already in use.
  3. Add a Set Variable script step and double-click it. If using FileMaker Pro 7, use a Set Field script step and set a field in the database with the same calculation as the Value calculation for the Set Variable script step.
  4. In the Set Variable Options dialog that pops up, name the variable $CNSAudit or something similar.
  1. Press Specify... next to the Value field.
  2. 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_StartupFile is visible and double-click it.
  2. For now, select everything in curly brackets after CNSAudit_StartupFile and delete it. If your solution contains multiple files, see the Setting up Multiple Files / Data Separation Model section for an explanation of the optional parameter for the CNSAudit_StartupFile function.
  3. Press OK to close the Specify Calculation dialog.
  4. Press OK to close the Set Variable Options dialog.
  5. Save and close the Startup script window.
  6. Create a script named Shutdown (or something similar) or edit an existing shutdown script if one is already in use.
  7. Add a Set Variable script step and double-click it. If using FileMaker Pro 7, use a Set Field script step and set a field in the database with the same calculation as the Value calculation for the Set Variable script step.
  8. In the Set Variable Options dialog that pops up, name the variable $CNSAudit or something similar.
  1. Press Specify... next to the Value field.
  2. 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_ShutdownFile is visible and double-click it.
  2. For now, select everything in curly brackets after CNSAudit_ShutdownFile and delete it. See the online CNS Audit Function Reference for an explanation of the optional parameter for the CNSAudit_ShutdownFile function.
  3. Press OK to close the Specify Calculation dialog.
  4. Press OK to close the Set Variable Options dialog.
  5. Save and close the Shutdown script window.
  6. Close the ScriptMaker / Manage Scripts dialog.
  7. Open the File Options dialog and switch to the Open/Close tab.
  8. In the When opening this file section, check the Perform script option.
  1. In the Specify Script dialog that pops up, select the Startup script created/edited in step 2.
  1. Press OK to close the Specify Script dialog.
  2. Back on the File Options dialog, in the When closing this file section, check the Perform script option.
  3. In the Specify Script dialog that pops up, select the Shutdown script created/edited in step 12.
  1. Press OK to close the Specify Script dialog.
  2. Press OK to close the File Options dialog.