Items Fixed by Flow Optimization
Too many SOQL queries: 201 Flow "Populate Chart of Accounts in Transaction"
Batch closing error - We can't save this record because the “Create a link to a Third Party Pledge” process failed (DUPLICATE_VALUE: Maximum number of duplicate updates in one batch (12 allowed). )
Defect
CPU Time Limit in TAPSS-891
891-002
Record Involved:
| All steps should be executed successfully | FAIL Batch 0076229 | Batch | Salesforce 20230529-2338 | UtilityLog | Salesforce
|
TECHNICAL FACTORS
Current Batch class by AQ (Managed packaged), code is hidden, thus, we cannot control the default size of the batch which is 10
There are Process Builder and Flow by AQ which design are also hidden:
Contact Default CAE Category
tbc--
One Usyd flow that were disabled to isolate testing
USYD_Transactions_afterInsertUpdate
SIMULATIONS/REPLICATIONS DONE:
MS tried to replicate the batch processing in SIT with lower batch size parameter of 1 in this record:
Batch 0076241 Record in SIT (10 batch items, with average of 35 to 45 Batch Items Transactions)
Ran this in execute anonymous in developer console:
String smartBatchId = 'a0ZBn000000Yx45MAC'; AQB.ProcessBatchItems aqSmartBatch = new AQB.ProcessBatchItems(smartBatchId); Database.executeBatch(aqSmartBatch, 1);
End Result: The batch record was closed successfully
2. MS also tested in RommelTest Sandbox with the latest version 24.0.1 - Batch 0075201 (10 batch items, with average of 35 to 45 Batch Items Transactions)
NOTE: The design of flows in RommelTest sandbox is the same with PROD (no optimization done yet)
1st Testing (Using the normal Close Batch button, the result is the same, we hit the CPU time limit issue
2nd Testing using the script with 1 batch size via execute anonymous in developer console, the Batch was closed successfully
3. Testing in UAT:
Unit Testing Variables:
10 Batch Items of different accounts
36 Transactions each Batch Item with payments, 2 of which no payments
Unit Testing Steps: Test User - Ana Simic
Created Batch record with Batch items and transaction records comparable to original related Production record.
Closed batch and received error on Utility Log (CPU limit not indicated on Details as UAT has different AQ package version).
Close the batch record using anonymous Apex script
String smartBatchId = 'a0ZBm000000AdT7MAK'; AQB.ProcessBatchItems aqSmartBatch = new AQB.ProcessBatchItems(smartBatchId); Database.executeBatch(aqSmartBatch, 1);
4. Received a successful log.
5. Batch Record was closed successfully