Create an Account, configure loan calculation properties, and run a calculation.

Key Objects Used

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 exists
If Not finBL.AccountTypes.Exists(AccountTypeId) Then
  finBL.Error.ErrorBeginFormat("Account Type '{0}' not found.", AccountTypeId)
  Return False
End 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 If
End With

' Run calculation
If Account.Calculation.Calculate() Then
  ' Read results
  Dim payment As Decimal = Account.Calculation.PaymentRegular
  Dim totalRepayments As Decimal = Account.Calculation.Schedule.TotalPayments()
End If
Source:
Sample Scripts / Script_ExternalLoanCalculator.xml (HTML Widget)