Date Field-Based Rule Generation for Extra Databases

To further automate rules, AbacusLaw has the ability to generate a specific rule for an extra database record when a date field is filled. For example, when the acquisition date is filled for an exhibit, a rule could be triggered based on that date and related events scheduled.

Displaying the Extra Database PK Field

When generating date field-based rules in extra databases, it is helpful to see the extra database primary key (PK) field. Follow these steps to display this field on the extra database tabs.

  1. Select File > Setup > System Options.

  2. The System Options window appears. On the Preferences tab, check Display ExtraDB PK on browses.

  3. Click Done.

  4. Open the Matter window and go to the extra database tab.

  5. The extra database primary key (PK) field will appear as the last field on the right. Click and drag it to a more visible place in the extra database browse.

Understanding the Trigger Syntax

The syntax to use for date field-based rule generation for extra databases is:

CreateEventsFromRule(oDbf,"<name of rule>","<name of field>", .T.)

or

CreateEventsFromRule(oDbf,"<name of rule>","<name of field>", .F.)

When CreateEventsFromRule(oDbf,"<name of rule>","<name of field>", .T.) is used, when the date field is completed or edited for an extra database record, a rule is triggered and the trigger event and linked events are scheduled for the record. The .T. tag causes the extra database primary key (PK) to be displayed in event browses and reports. Note that the PK notation (for example, <<<Exhibits:1>>>) is only written to the trigger event of the rule. The PK notation is required to keep track of which events belong to which extra database record.

When CreateEventsFromRule(oDbf,"<name of rule>","<name of field>", .F.) is used, when the date field is completed or edited for an extra database record, again a rule is triggered and the trigger event and linked events are scheduled for the record. However, the .F. tag causes the extra database primary key (PK) to be hidden in event browses and reports.

Example of .T. Tag

Assume that CreateEventsFromRule(oDbf,"CFEXPDEP","EXDATE", .T.) is used for the Date Acquired field in the Exhibits extra database. Completing or editing the Date Acquired field for an Exhibit record would trigger a deposition rule and schedule related events. The extra database primary key (PK) would display in browses and reports for these events.

Example of .F. Tag

Assume that CreateEventsFromRule(oDbf,"CFEXPDEP","EXDATE", .F.) is used for the Date Acquired field in the Exhibits extra database. Again, completing or editing the Date Acquired field for an Exhibit record would trigger a deposition rule and schedule related events. However, the extra database primary key (PK) would be prefixed with 3 asterisks (***), which hides the information in browses and reports for these events.

Creating the Date Field-Based Rule Generation Mechanism

The rule generation mechanism is the trigger for the rule.

  1. Select ExtraDBs > Setup Extra Databases.

  2. The Extra Databases Setup window appears. Click Edit and click Screen Layout.

  3. Highlight the extra database date field you want to trigger the rule and click Edit Field.

  4. In the Valid Condition field, enter the appropriate trigger syntax.

  5. Click Done.

Using Date Field-Based Rule Generation in Extra Databases

Once the mechanism is in place for Date Field-Based Rule Generation in the extra database, users initiate the rule by populating the trigger date field for the extra database record.

  1. Add a record for an extra database. When you complete the date field with the rule trigger, a message appears. Click Yes.

  2. The Linked Events Browse window appears. Click Done to schedule the linked events.

  3. Complete any remaining fields for the extra database record. Click Done to save.

Once the events from the rule are created, the date field no longer triggers the rule. However, if the value in the date field is changed, then AbacusLaw will prompt to recalculate the existing events.

  1. Edit the record in the extra database and change the date field with the rule trigger. A message asks you if you want to change the previous linked events created by the rule. Click Yes.

  2. For each date recalculation, select Yes to recalculate. Click Yes to all to recalculate all the dates according to the rule.

  3. Click Done for the extra database record to save all the date recalculations.