Create an Account, configure loan calculation properties, and run a calculation.
Key Objects Used
finAccount
finBL.AccountTypes
Code
Dim Account As finAccount
Dim AccountTypeId As String = "PERSONAL"Dim Amount As Decimal = 10000
Dim Term As String = "36"' Validate that the Account Type existsIfNot finBL.AccountTypes.Exists(AccountTypeId) Then
finBL.Error.ErrorBeginFormat("Account Type '{0}' not found.", AccountTypeId)ReturnFalseEnd If' Create Account and configure calculation
Account = finBL.CreateAccount()
With Account.Calculation
If .LoadAccountType(AccountTypeId) Then
.StandardTransactions.SetAdvance(Amount)
.TermCycle = Term & " Months"
.PaymentCycle = "Months"End IfEnd With' Run calculationIf Account.Calculation.Calculate() Then' Read resultsDim payment As Decimal = Account.Calculation.PaymentRegular
Dim totalRepayments As Decimal = Account.Calculation.Schedule.TotalPayments()
End If