Issues/Errors Encountered and Workaround
Background
During the initial attempt of the Receipting process, some related flows and process builders were producing errors, halting the completion of the process. These flows and process builders are listed below:
Process Builder - Automate task for GA for Pledge (v2)
Process Builder - Description - HOLD RECEIPT (v4)
Flow - AQC Donor Contact Type Auto-Updater (v2)
Flow - (Affinaquest) Update Gift Designations (v1)
The Workaround
Since the Receipting process is important, and there’s no quick fix that can address the errors being encountered when the above process builders and flows are enabled, it was decided that these automations will just be disabled temporarily, and then manually do the intended updates/operation of each, once the Receipting process is completed.
Process Builder - Automate task for GA for Pledge - Disabled
The process builder creates Task record for each updated Gift/Pledge record that went into ‘Pending review’ status. Since this is disabled during the Receipting process, due checks were done to determine if there are Gift/Pledge records that require manual creation of the relevant Task record.
Below are the steps done to check if there are records that require manual creation of Task record:
First check: SOQL to see if there are Gifts/Pledges records that are in ‘Pending review’ covering the FY.
SELECT Id, AQB__Gift__r.name,AQB__Gift__r.USyd_Pledge_Status__c FROM AQB__Transaction__c WHERE DAY_ONLY(CreatedDate) >= 2022-07-01 AND DAY_ONLY(CreatedDate) <= 2023-06-30 AND AQB__Gift__r.USyd_Pledge_Status__c = 'Pending review'
Result: The above SOQL, when summarized resulted in 5 Gift/Pledge Records, which already has automatically created Task records. No manual record update or record creation done.
Gift/Pledge Number | Comments |
2341283 | With automatically generated task |
2345964 | With automatically generated task |
2359231 | With automatically generated task |
2368046 | With automatically generated task |
2370440 | With automatically generated task |
Second check: SOQL to check if there are Gift/Pledge that are in ‘Pending review’ based Transaction records' related Receipt’s creation date (vs Receipting date).
SELECT COUNT() FROM AQB__Transaction__c WHERE DAY_ONLY(AQB__Receipt__r.CreatedDate) = 2023-07-07 AND AQB__Gift__r.USyd_Pledge_Status__c='Pending review'
Just another approach of checking, but the goal is the same - to identify if there are Gift/Pledge records that are in ‘Pending review’ that may need manual creation of relevant Task record.
Result: The above SOQL yielded 0 result. This means no Gift/Pledge record requires manual creation of auto-generated Task record. No manual record update or record creation done.
Process Builder - Description - HOLD RECEIPT - Disabled
This process builder is triggered when Transaction is created or edited. This process builder has two criteria nodes, and so the details below were segregated per criteria node. Here are the criteria nodes based on each criteria node name:
Check if the receipt on hold is checked.
Copy description to text area field
Node 1: “Check if the receipt on hold is checked.”
Condition (translated to semi pseudo-code):
AQB__OriginatingBatchItemTransaction__r.AQB__BatchItemID__r.AQB__ApproveReceipt__c IS TRUE AND AQB__OriginatingBatchItemTransaction__r.AQB__Description__c IS NOT NULL AND AQB__Batch__r.RecordTypeId='0124a0000004KatAAE'
Action:
Action Operation: Update Records
Name: Update Receipt Description
Target Record(s): Related Gift/Pledge Record’s Receipts
Target Field(s): Receipt On Hold Reason
Since this process builder was disabled, the following SOQL statement was executed to check if there are records that need manual update. This SOQL statement is based on the criteria defined in this criteria node.
SELECT COUNT() FROM AQB__Transaction__c WHERE DAY_ONLY(AQB__Receipt__r.CreatedDate) = 2023-07-07 AND AQB__Batch__r.RecordTypeId='0124a0000004KatAAE' AND AQB__OriginatingBatchItemTransaction__r.AQB__BatchItemID__r.AQB__ApproveReceipt__c=TRUE
Result: The SOQL above produced 0 rows. This means that if the process builder was enabled during the Receipting process, no record will be processed by this particular node because no records met the defined condition/criteria, hence no record are to be manually updated. No manual record update or record creation done.
Node 2: Copy description to text area field
Condition (translated to semi pseudo-code):
Transaction Description field IS NOT NULL AND Transaction Description field ISCHANGED
Action
Type: Update Records
Name: copy details to text area field
Target Record(s): (Current) Transaction
Target Field(s): Text Area Description
Since this process builder was disabled, based on the above condition of this criteria node, the following SOQL statement was executed to check if there are records that need manual update.
SELECT COUNT() FROM AQB__Transaction__History WHERE Field='AQB__Description__c' AND ParentId IN ( SELECT Id FROM AQB__Transaction__c WHERE DAY_ONLY(AQB__Receipt__r.CreatedDate) = 2023-07-07 )
AQB__Transaction__History
object is used to determine if there were changes that happened on the applicable Transaction records' AQB__Description__c
field, which is part of the condition (Is changed operator).
Result: This SOQL statement returned 0 when executed, hence there’s no record to update or process manually. No manual record update or record creation done.
Flow - AQC Donor Contact Type Auto-Updater - DISABLED
The flow is triggered when a Gift/Pledge is updated, with not defined entry criteria. The flow logic is defined into two parts:
Set Gift Driver Derivation (Usyd_Gift_Driver_Derivation__c) to TRUE when the record’s account changes.
Set the primary/secondary type to Donor if not yet Donor.
First Part: Set Gift Driver Derivation (Usyd_Gift_Driver_Derivation__c) to TRUE when the record’s account changes
To check if there were data that needs to be manually updated, the following SOQL statement were executed:
SELECT COUNT() FROM AQB__Gift__History WHERE Field='AQB__Account__c' AND DAY_ONLY(CreatedDate)=2023-07-07 AND ParentId IN ( SELECT AQB__Gift__c FROM AQB__Transaction__c WHERE DAY_ONLY(AQB__Receipt__r.CreatedDate) = 2023-07-07 )
Result: This SOQL statement returned 0 when executed, hence there’s no record to update or process manually. No manual record update or record creation done.
Second Part: Set the primary/secondary type to Donor if not yet Donor
In the Receipting process, contact types are not expected to move. No manual record update or record creation done.
Update Gift Designation - Disabled
This is a managed package (Affinaquest) flow which has a known issue. So it was recommended to for this to be turned-OFF. No manual record update or record creation done.