Canadian Tax Receipting Upgrade Steps

There are 3 major changes from 1.x to 2.x that require work during the upgrade:

  • Receipt generation logic uses custom metadata, updated from Apex code
  • PDF Template generator controller allows for 1 visualforce layout to support multiple templates
  • The relationship between an original receipt and the replacement receipt was reversed (each new receipt can replace multiple prior receipts)

Pre-work for an Upgrade

Review existing Receipt Template VF pages and figure out how many distinct layouts are in use: in 1.x a new VF page was created for each template, in 2.0 we try to limit the number of layouts (and most orgs only need 1 or 2 distinct layouts)

Review the number of receipts with a value in the Replaced Receipt field. Larger data volumes will need to be handled by ESW. It is much easier to pull this data out of the system before the upgrade.

Check for a custom mapping class – In Custom Settings > Receipt Settings. The Mapping Class field should have a receipting namespace. If it references a custom apex class, then the client has a custom mapping class that will require some extra work

I recommend taking screenshots of the receipt settings pages (including template assignments) before the upgrade as well

Upgrade Steps, Misc

After the package is installed, run the follow code snippets to modify existing data

Snippet for copying assignment priority numbers to priority 2

List<kell6_core__Receipt_Template_Assignment__c> assignments = [Select Id, kell6_core__Filter_Logic__c, kell6_core__Priority2__c, kell6_core__Priority__c, kell6_core__Receipt_Numbering_Name__c, kell6_core__Receipt_Template_Name__c From kell6_core__Receipt_Template_Assignment__c];
for (kell6_core__Receipt_Template_Assignment__c assign : assignments) {
    assign.kell6_core__priority2__c = assign.kell6_core__priority__c;
}
update assignments;
Click to copy

Code snippet for copying template name to VF template page field:

List<kell6_core__Receipt_Template_Content__c> templates = [Select Id, kell6_core__Receipt_Template_VF_Page__c, kell6_core__Receipt_Template_Name__c From kell6_core__Receipt_Template_Content__c];
for (kell6_core__Receipt_Template_Content__c template: templates) {
template.kell6_core__Receipt_Template_VF_Page__c = template.kell6_core__Receipt_Template_Name__c;
}
update templates;
Click to copy

Additional work on the Template Assignment object:

The Type field picklist values must be changed (and existing replaced)

Recurring Donation Receipts -> Consolidated Receipts

Event Receipts -> Transaction Receipts

Custom Mapping Class Updates

You will need to adjust custom metadata for anything in the mapping class that is custom. Unfortunately, unless this was well documented in the client org (which is unlikely), the only way to do it would be to compare the custom metadata to the out of the box custom metadata line by line.

NOTE: there are sections for AccompanyingLetterPlaceholders and AccompanyingLetterInstallmentPlaceholders that have no equivalent in the custom metadata. That’s because they are needed in 2.0 – any field on the receipt can be used in letter text automatically

Data Work

All receipts with receiptId and replacedReceiptId

Update, mapping replacedreceiptId to the receiptId field, and receiptId to the 'replaced by' receipt field. This reverses the relationship between replacement receipts and the receipts that they replaced

VF Work

For each new visualforce page (remember that there will be fewer of these than the number of templates that the client is using). You will need to replace merge fields with the fields listed in this screensteps documentation: https://kell.screenstepslive.com/s/smartpacks/m/24295/l/1287497-creating-a-new-visualforce-receipt-layout . Usually this takes under 2 hrs per visualforce page (Note that standard upgrade SOWs don’t include updates or tweaks to templates)