Attention: Confluence is not suitable for the storage of highly confidential data. Please ensure that any data classified as Highly Protected is stored using a more secure platform.
If you have any questions, please refer to the University's data classification guide or contact ict.askcyber@sydney.edu.au
TAP-1303: Update Batch Logic
Persona + Need + Purpose
As a GA user
I want to update the batch logic by turning off the existing flow “Batch - On Update - After Save” and rewrite the logic as below:
Batch Item(created/updated) and Link to Opportunity field is updated or not null
Check the related batch- batch review status = “Ready for Review”
If above two conditions are true move the Link to Opportunity- > GIN → Stage = GA-Approval
So that I am alerted when I need to review a change to a batch
Acceptance Criteria
At Batch Item when Link to Opportunity is updated (Created/Update) and check if Batch Review status NE Ready for Review update GIN stage = GA- entry
Note: No code logic to cover try to re-use any flow if possible
At Batch Item when Link to Opportunity is updated (Created/Update) and check if Batch Review status = Ready for Review => Update the GIN stage = GA-Approval
Note: Check existing flow “Batch - On Update - After Save” if above condition satisfied
If GIN - Gift/pledge updated/is changed => GIN stage = GI-Kickoff
Note: There is a flow which updates please check and re-use “Gift/Pledge - On Create - After Save”
[GIN stage of GI - Kickoff is now being managed by flow USYD Update Related Gift Implementation. See TAP-902 (Jira ticket, confluence page) ]
Business Area
GA
Business Value
Ability to track changes to batch for review
Table of Contents
- 1 Components Added/Modified:
- 2 Implementation:
- 3 Unit Testing Steps
- 3.1 Batch Item After Save | Populate Pledge Reminder Owner
- 3.2 Batch Item After Save | Update Batch Item Tasks
- 3.3 Batch Item After Save | Update Related Gift Implementation
- 3.4 Batch Item After Save | Notify Gift Implementation Group
- 3.5 Batch Item Before Save
- 3.6 Batch After Save | Batch Update Related Gift Implementation
Components Added/Modified:
Label | API Name | Type | Type - Description | sObject | New/Update | Description/Change |
---|---|---|---|---|---|---|
Batch Item Pledge Payment changes Notify Gift Implementation | Batch_Item_Pledge_Payment_changes_Notify_Gift_Implementation | PB | process builder | Batch Item | Deactivated | translated to subflow(auto-launched flow), USYD_NotifyGiftImplementationGroup |
Tax Amount Update from Total Amount Field | Tax_Amount_Update_from_Total_Amount_Field | PB | process builder | Batch Item | Deactivated | logic is now part of before save flow: USYD_BatchItemBeforeSave |
Pledge Reminder Owner Auto-populate | Pledge_Reminder_Owner_Auto_populate | PB | process builder | Batch Item | Deactivated | translated to subflow(auto-launched flow), USYD_PopulatePledgeReminderOwner; logic about setting the Text Area Description is now part of before save flow: USYD_BatchItemBeforeSave |
Usyd Update the Gift/Pledge number at Batch item task level when batch closed | Usyd_Update_the_Gift_Pledge_number_at_Batch_item_task_level_when_batch_closed | Flow | record-triggered flow | Batch Item | Deactivated | translated to subflow(auto-launched flow), USYD_UpdateBatchItemTasks |
Batch On Update After Save | Batch_On_Update_After_Save | Flow | record-triggered flow | Batch | Deactivated | Translated to a subflow: Batch Update Related Gift Implementation, and referenced it in Batch After Save |
Populate Pledge Reminder Owner | USYD_PopulatePledgeReminderOwner_subflow | Flow | auto-launched flow | Batch Item | New | translated from process builder; subflow of USYD_BatchItemAfterSave |
Notify Gift Implementation Group | USYD_NotifyGiftImplementationGroup_subflow | Flow | auto-launched flow | Batch Item | New | translated from process builder; scheduled; subflow of USYD_BatchItemAfterSave |
Update Batch Item Tasks | USYD_UpdateBatchItemTasks_subflow | Flow | auto-launched flow | Batch Item | New | translated from record-triggered flow; subflow of USYD_BatchItemAfterSave |
Update Related Gift Implementation | USYD_UpdateRelatedGiftImplementation_subflow | Flow | auto-launched flow | Batch Item | New | subflow of USYD_BatchItemAfterSave |
Batch Update Related Gift Implementation | USYD_BatchUpdateRelatedGiftImplementation_subflow | Flow | auto-launched flow | Batch | New | sublflow of USYD_BatchAfterSave |
Batch Item After Save | USYD_BatchItemAfterSave | Flow | record-triggered flow | Batch Item | New | after save, parent flow, Main triggering after-save flow for Batch Item object. |
Batch Item Before Save | USYD_BatchItemBeforeSave | Flow | record-triggered flow | Batch Item | New | before save; Caters fast-field updates for batch item object. |
Batch After Save | USYD_BatchAfterSave | Flow | record-triggered flow | Batch | New | after save, parent flow, Main triggering after-save flow for Batch object |
USYD Create Application Log (subflow) | USYD_Create_Application_Log_subflow | Flow | auto-launched flow | - | New | Reusable flow that creates an application log record when fault paths are traversed |
CUSTOM_NOTIFICATION_TYPE_ID_SYDNEY_STANDARD_NOTIFICATION | CUSTOM_NOTIFICATION_TYPE_ID_SYDNEY_STANDARD_NOTIFICATION | Custom Label | Labels | - | New | Custom Notification Type Id: Sydney Standard Notification |
Implementation:
Create a new flow Batch Item After Save.
record-triggered, when a record is created or updated; After Save.
Triggering object: Batch Item.
Create fault paths to document errors.
flow chart:
Batch Item After Save
A. Translate the following processes (process builders) to flows as subflows and reference them in Batch Item After Save:
a. Batch Item Pledge Payment changes Notify Gift Implementation
i. with scheduled custom notification; used a scheduled path to cater this requirement.
ii. new name: Notify Gift Implementation Group.
Set a Scheduled Path: gets triggered 1 hour after creation of batch item.
Notify Gift Implementation Group (PB converted to Flow)
b. Tax Amount Update from Total Amount Field
i. logic of this process is now part of before save flow: Batch Item Before Save.
c. Pledge Reminder Owner Auto-populate
i. new name: Populate Pledge Reminder Owner.
Populate Pledge Reminder Owner (PB converted to Flow)
Set Entry condition. This restricts the subflow to process only those batch item records with a pledge reminder owner field populated.
Get associated Gift/Pledge record of batch item.
Check if a Gift/Pledge record is fetched.
Set the value for Pledge Reminder Owner field on fetched Gift/Pledge record. This copies value from batch item.
Set the giftPledge and updateGiftPledgeCounter variables, which then get passed to the parent flow for field updates.
B. Convert to a subflow flow Usyd Update the Gift/Pledge number at Batch item task level when batch closed and reference in Batch Item After Save.
a. new name: Update Batch Item Tasks.
Update Batch Item Tasks
Set Entry Conditions. This restricts the subflow to only process batch item records with new/updated gift/pledge number, or signator, or campaign appeal.
Get related task records of batch item with subject of bequest intention or bequest confirmation.
Check if any child task is fetched.
Loop through all the fetched child tasks.
Set values to the fetched child tasks' gift/pledge, name ID, and campaign fields.
Set values for Tasks and updateTasksCounter variables, which then get passed to the parent flow for field updates.
Update Related Gift Implementation (New Flow)
C. Create a new subflow Update Related Gift Implementation and have this referenced in Batch Item After Save.
a. Users may sometime add/update a Link to Opportunity in Batch Item at a later time on occasions that they realize that they missed adding a Link to Opportunity/entered an incorrect Link to Opportunity. This flow will cater to this type of scenario.
Set Entry Condition. This restricts the subflow to only process batch item records with their Link to Opportunity updated. If Link to Opportunity is updated from blank to something, the Update GIN of Current Opportunity outcome gets satisfied. Else, e.g. Link to Opportunity is updated from one opportunity to another, the Update GIN of Current and Prior Opportunity outcome gets satisfied. Both outcomes only process open batches.
Is Link to Opportunity Updated?
Outcome: Update Gift Implementation of Current Opportunity
Fetch all child Gift Implementations of Link to Opportunity.
Check if any child Gift Implementations are fetched.
Loop through all the fetched child Gift Implementations of Link to Opportunity.
Set the Stage on all fetched child Gift Implementations of Prior Link to Opportunity accordingly. Set GIN Stage to “3. GA-Entry” when Batch Review Status Not “Ready for Review”; Set to “4. GA-Approval” when Batch Review Status is Ready for Review. Update a toggle field in GIN object to signify that its the flow that will makethe field update.
Set giftImplementations and updateGiftImplementationCountervariables, which will then get passed to parent flow for field updates.
Update Gift Implementation of Current and Prior Opportunity outcome
Fetch the latest batch item record associated to Prior Link to Opportunity.
Fetch child Gift Implementations of Prior Link to Opportunity.
Check if any child GINs are fetched.
Loop through all fetched child GINs of Prior Link to Opportunity.
Set the Stage on all fetched child Gift Implementations of Prior Link to Opportunity accordingly. Set GIN Stage to “3. GA-Entry” when Batch Review Status Not “Ready for Review”; Set to “4. GA-Approval” when Batch Review Status is Ready for Review. Update a toggle field in GIN object to signify that its the flow that will make the field update.
Set the GINs and udpateGINCounter variables, which will then get passed to the parent flow for field updates.
Flow to continue with the same process of the Update Gift Implementation of Current Opportunity outcome.
2. Create a new flow Batch Item Before Save to cater fast field updates on the batch item level.
Batch Item Before Save (New Flow - PB absorbed)
Set a decision on when to update the tax amount in the triggering batch item record. Only update tax amount when Dues is set to True.
Set Tax Amount by using the formula taxAmountCalculation: Total Amount/11.
Set a decision on when to update the Text Area Description in batch item. Only do the update when Transaction 1 Description is not null or when it is changed to something different.
Set the value for Text Area Description in batch item by copying what’s in the Transaction 1 Description.
3. Optimize and translate flow Batch_On_Update_After_Save to a subflow Batch Update Related Gift Implementation and reference it in Batch After Save.
Batch After Save
Batch Update Related Gift Implementation (New Flow)
Set Entry Condition. This restricts the subflow to only process batch records when its Review Status is updated to another status, and when the batch itself is still open.
Fetch child batch items of the triggering batch record.
Loop through all the child batch items of the batch record.
Set values for linkToOpportunityIds. This variable stores fetched Link to Opportunities for each of the child batch items.
Fetch the child Gift Implementations of captured Link to Opportunities.
Check if any child Gift Implementations are fetched.
Loop through all the fetched child GINs.
Set the GIN Stage of child GINs accordingly. Set GIN Stage to “3. GA-Entry” when Batch Review Status Not “Ready for Review”; Set to “4. GA-Approval” when Batch Review Status is Ready for Review. Update a toggle field in GIN object to signify that its the flow that will make the field update.
Set values for giftImplementations and updateGiftImplementationCounter variables, which will then get passed to the parent flow for field updates.
Unit Testing Steps
Batch Item After Save | Populate Pledge Reminder Owner
Associate a gift/pledge to a batch item.
2. Below is a sample gift/pledge. Notice that pledge reminder owner in this record is initially set to blank.
3. Update the batch item record’s Pledge Reminder Owner. Add a Pledge Reminder Owner, then hit save.
4. Notice that after saving the batch item record, the Pledge Reminder Owner of the associated gift/pledge gets automatically updated. The Pledge Reminder Owner value of batch item is passed over to the associated gift/pledge’s Pledge Reminder Owner.
Batch Item After Save | Update Batch Item Tasks
Create a task(s) in a batch item. Select Bequest Intention or Bequest Confirmation as the subject.
2. Update the batch item’s Campaign Appeal or Signator or Gift/Pledge Number. Whenever any of these three fields is updated. The subflow gets triggered.
Below is a sample batch item with its Campaign being updated from “Test Campaign” to “Campaign 1.”
3. After the batch item is updated, notice that its related task(s) gets updated as well. Check the task’s Campaign/Gift/Pledge/Name to verify.
Batch Item After Save | Update Related Gift Implementation
Prepare a batch with no set Review Status.
Create a batch item with no Link to Opportunity.
Update the Link to Opportunity of the child batch item(s). Use an Opportunity that has related Gift Implementation records (e.g. Opportunity A).
Once the batch item(s) is saved, notice that the related Gift Implementation Stage of the Link to Opportunity is updated to: 3. GA-Entry.
Now, go back to the batch and update the review status from NULL to Ready for Review.
Then, update the child batch item(s)’s Link to Opportunity to a different Opportunity (e.g. Opportunity B).
Once the batch item(s) is saved, notice that the related Gift Implementation Stage of the Link to Opportunity (Opportunity B) is updated to: 4. GA-Approval. Also, notice that the related Gift Implementation Stage of the Prior Link to Opportunity (Opportunity A) may be updated to 3. GA-Entry or 4. GA-Approval depending on the batch review status of the latest batch item of the Prior Link to Opportunity (Opportunity A).
Note: Stage of related Gift Implementation is being set to 3. GA-Entry when Batch Review Status is Null or Not Ready for Review; 4. GA-Approval when Batch Review Status is Ready for Review.
Other Scenarios:
Batch Review Status | Batch Item Link to Opportunity | Batch Item Prior Link to Opportunity | Expected Gift Implementation Stage of Link to Opportunity | Expected Gift Implementation Stage of Prior Link to Opportunity |
---|---|---|---|---|
NULL | Opportunity A | NULL | 3. GA-Entry | N/A |
NOT Ready for Review | Opportunity A | NULL | 3. GA-Entry | N/A |
Ready for Review | Opportunity B | Opportunity A | 4. GA-Approval |
|
NOT Ready for Review | Opportunity B | Opportunity A | 3. GA-Entry |
|
Batch Item After Save | Notify Gift Implementation Group
Make sure that tester is a member of the Gift Implementation group.
Create a batch item with a record type of Pledge Write Off, and a write off notation of any of the following:
Pledge dates changed
Pledge dates and amounts changed
Pledge Instalment amount changed
Total Pledge amount increased
Total Pledge amount decreased
Make sure that the batch item has the following:
Link to Pledge
Credited Opportunity is populated
Transaction 1 Designation
Account
Once the batch item is saved, wait for an hour. (You may also adjust the offset number/option in the Batch Item After Save flow’s schedule path to a lower wait time for testing so that you would not have to wait too long, just set it back to its original configuration after your testing).
Once the wait time is finished, expect for a notification like so,
Batch Item Before Save
Create a batch item and check the following:
Set Dues to TRUE.
Enter an amount in the Total Amount field.
Enter a text in Transaction 1 Description.
Once the batch item record is saved, notice the following:
The Tax Amount is now calculated.
Values from Transaction 1 Description are copied over to the Text Area Description.
Batch After Save | Batch Update Related Gift Implementation
Create a batch with a child batch item(s). Make sure that the child batch item(s) has a Link to Opportunity (e.g. Opportunity A), and that the Opportunity has a Gift Implementation.
Update the batch review status from NULL to Ready for Review.
Once the batch is saved, notice that the related Gift Implementation Stage of the Link to Opportunity (Opportunity A) of the child batch item(s) of the triggering batch is updated to 4. GA-Approval.
Note: Stage of related Gift Implementation is being set to 3. GA-Entry when Batch Review Status is Null or Not Ready for Review; 4. GA-Approval when Batch Review Status is Ready for Review.
Other Scenarios:
Batch Review Status | Batch Item Link to Opportunity | Expected Gift Implementation Stage of Link to Opportunity |
---|---|---|
NULL | Opportunity A | 3. GA-Entry |
NOT Ready for Review | Opportunity A | 3. GA-Entry |
Ready for Review | Opportunity A | 4. GA-Approval |