Article Details
| Id: | 13016 |
| Product: | finPOWER Connect |
| Type: | FIX |
| Version: | 2.03.00 |
| Opened: | 19/06/2015 |
| Closed: | 19/06/2015 |
| Released: | 09/07/2015 |
| Job: | J015744 |
Business Layer; finAccountCalculationVersion.Summary may fail
The finPOWER Connect Business Layer method finAccount.CalculationVersions(index).Summary may fail with the error "Object reference not set to an instance of an object.".
An example of code to reproduce the issue is below.
Dim Account As finAccountDim AccountSummary As finAccountSummary' Assume SuccessMain = TrueAccount = finBL.CreateAccountIf Account.Load("L10035") ThenAccountSummary = Account.CalculationVersions(0).SummaryElseMain = FalseEnd If
A workaround is to load the Account Calculation first, example code below:
Dim Account As finAccountDim AccountCalc As finAccountCalcDim AccountSummary As finAccountSummary' Assume SuccessMain = TrueAccount = finBL.CreateAccountIf Account.Load("L10035") ThenIf Account.CalculationVersions(0).GetAccountCalc(AccountCalc) ThenAccountSummary = Account.CalculationVersions(0).SummaryElseMain = FalseEnd IfElseMain = FalseEnd If
Note, this issue has been fixed in version 2.3.0.