Skip to Main Content
Workspace Investor Relations
Created by Guest
Created on Oct 15, 2019

Capital Account & Capital Account Parent Triggers Intermittent Incorrect Calculation

A bug was found when deploying package 3.7. The As Of and Previous As Of fields on the Capital Account and Capital Account Parent objects were changed from being of type DateTime to type Date. As a post deploy script, the data was updated in these new fields.

**Background**
------------------

When updating all Capital Accounts the trigger acts differently to how it acts when updating Capital Accounts grouped by Capital Account Parent. This was discovered after installing package 3.7 where some of the currency fields on the Capital Account Parent were incorrect (e.g. Total Capital Balance, Total Contributed Capital, Total Distributions, etc).

A recalculation fix was discovered when using the Mass Update button on a Capital Account Parent and updating a field on all Capital Accounts to the same value.
It was assumed that by updating all Capital Accounts without changing anything, the values could be returned to their proper values. This caused the values to return to the post package 3.7 installation state.
Based on the Mass Update process, it was found that the Capital Accounts could be updated correctly when updating Capital Accounts grouped by their Capital Account Parent.

**Purpose of this card**
--------------------------

Investigate the following triggers to find out why Capital Accounts are being updated incorrectly when updating all Capital Accounts at once.
Three trigger classes are run when creating/updating a Capital Account:

- CapitalAccountTL_PreventDelete
- CapitalAccountTL_DoCalculation - Calls method in the class CapitalAccounts
- CapitalAccountTL_RollupCalculationFlag

The record Capital Acct Parent 3678 in the developer org is affected by this bug and can be used for testing.
https://ap1.salesforce.com/a0F9000000v0I3J

The record Capital Acct Parent 0 in another test org is also affected by this bug and can be used for testing.
https://ap2.salesforce.com/a012800000eGv2Z
Username: aduro0916@test.com
Password: aduro000

**Related Cards**

- https://trello.com/c/XrjnPD1A/184-capital-account-date-field
- https://trello.com/c/1dxv7OiI/204-capital-account-parent-records-have-incorrect-values-after-package-update

  • Attach files