Error: The marketing effort cannot be deleted because it is associated with a revenue record

When a marketing effort is activated, it begins tracking associated gifts, whether they have the actual mailing associated with them or just the associated appeal and source code. In order to delete a marketing effort, users must ensure that there are no revenue records in the database that specifically reference this mailing. However, even after deleting the effort from all revenue in the database, users may still receive the error:

The marketing effort cannot be deleted because it is associated with a revenue record.

Article
Number:62901

Products:

Blackbaud_CRM

This issue occurs when there are any traces of the marketing effort in the REVENUE and BATCHREVENUE tables in SQL.

To resolve the issue:

1. Run the following two scripts (replacing the value in red with the correct GUID for the marketing effort):