Diagnostics and User Alerts
Overview
The Loan Diagnostics utility in Q2 Loan Servicing is used to diagnose potential problems with loan data. The feature promptly notifies users about any discrepancies.
The system consists of diagnostics for the following two:
Interest Diagnostics: The interest diagnostics feature has been introduced to find out if the interest calculated on a loan is incorrect. This is done with the help of a batch process which can be run at any time. The interest discrepancy is logged in the Diagnostic Status object. A tolerance amount needs to be specified at the org level to determine the tolerance amount allowed as part of the diagnostics. This amount defines the amount limit above which the diagnostic process will alert on the discrepancy.
Principal Balance Diagnostics: Similar to the interest diagnostics, the system also comes with principal diagnostics feature that finds out of if the Loan Balance/ Principal Remaining is not the expected amount. Again any discrepancy is logged in the Diagnostics Status object.
DAG Job for Interest Diagnostics
The DAG Job is designed to run interest diagnostics on contracts. It performs calculations to compare the total interest on a loan contract with the expected total interest value based on the transactions posted on the contract. The job is scheduled to run weekly and considers contracts where transactions occurred in the previous week. The DAG Job is set to run every week. It is triggered on a specified day and time to process contracts with transactions in the previous week. The job validates interest calculations using the last six months of data. This ensures that the interest calculations are accurate and reliable.
The job calculates the total interest on a loan contract until the last transaction date. It considers all transactions posted on the contract, including interest paid, interest posted, interest remaining, adjusted interest, and adjusted interest non-cap. The calculated total interest is compared with the total interest value on the contract.
DAG Job for Principal Balance Diagnostics
The User Alert for discrepancy between Actual and Expected Outstanding Balance is a system feature that notifies users when there is a difference between the actual outstanding balance and the expected balance. This feature helps users stay informed about any discrepancies and enables them to take appropriate actions to resolve the issue. If there is a difference between the two, the system generates a user alert. This feature ensures that the actual principal balance aligns with the expected balance, enabling timely identification and resolution of any discrepancies.
At the end of the interest computation process, the system performs the Principal Balance comparison as part of the existing diagnostic and alert flow. The expected Principal Balance is derived based on the sum of all principal payments made up to the current transaction. If the expected Principal Balance differs from the current principal remaining, a Diagnostic Log is generated, capturing the loan account, actual value (current Principal Remaining), and calculated value (expected Principal Balance).
For contracts with capitalization enabled, the Diagnostic entry consists of actual/expected capitalized interest values and non-capitalized interest values separately.
The Diagnostic Log page has four new fields added:
Actual Capitalized Interest Value
Calculated Capitalized Interest Value
Actual Non-Cap Interest Value
Calculated Non-Cap Interest Value
When the discrepancy values are above a specified tolerance value, then the system logs the errors on the diagnosis status page. By default, the tolerance value is set to +10% or -10% of the expected total interest. If the difference between the calculated total interest and the total interest value on the contract exceeds the tolerance value, the system logs an entry in the Diagnostic object. This entry captures the details of the contract and the variation from the expected total interest. The system creates a log file that maintains the status check of every contract.
If discrepancy is found, then a record is created on the Diagnostic Status page, and this sets the following discrepancy found fields to true accordingly:
Interest Discrepancy Found = This is selected by the Diagnostic Job to indicate that the contract's interest amounts are not matching.
Principal Discrepancy Found = This is selected by the Diagnostic Job to indicate that the contract's principal amounts are not matching.
On the next run of the Diagnostic Job, if the discrepancies are not found, then these record flags are set to false.
Add the InterestAndBalanceDiagnostic job to the system
The InterestAndBalanceDiagnostice job is run to help find any discrepancy in the interest and the loan balance. If there is a discrepancy in the interest or the loan balance, then it creates a Diagnostic Log record and deletes the old one. This job creates separate entries for both interest and loan balance discrepancies.
When the InterestAndBalanceDiagnostic Job is run for the first time in an org with the default batch size as 200, it would need to query all transactions for every contract, and therefore, would hit the Salesforce limit. Therefore, we recommend users to run the job with low batch size of maximum 30 and instance size of 5. Otherwise, the system will throw the following errors: "Too many query rows: 50001."
Steps to add the InterestAndBalanceDiagnostic job to the system
All the following steps need to be performed while doing a fresh installation as well as an upgrade to Spring'23. However, if it is a fresh install of Spring'23, then you need not perform step 4 as it is performed automatically by the system.
Add the Diagnostics Job in DAG Schedules
Perform the following steps to add the diagnostics job in DAG Schedules:
Log in to your Salesforce application.
-
Go to (App Launcher) and search for DAG Schedules and click it.
Click New.
Specify the DAG Name as follows: Loan Diagnostic Job
Click Save.
Click Related.
In the Jobs section, click New.
-
In the New Job window, add the following details, and then click Save:
Note:You can refer to the image following the table as a sample.
Field Name Value Batch Size 30
Note:This is the recommended maximum size, as, otherwise, the system would throw an error.Class loan.InterestAndBalanceDiagnosticJob Fail Type Logging Label Interest And Balance Diagnostic Job Number Of Instances 1 Pipelined False User Query (You can leave this field empty.) Default Query (You can leave this field empty.)
Perform the following steps to add Diagnostic Log object tab:
Log in to your Salesforce application.
Go to (Setup) > Setup.
In the Quick Find box, search for Tabs and click it.
In the Custom Object Tabs section, click New.
In the New Custom Object Tab window, in the Object field, select Diagnostic Log from the drop-down list.
In the Tab Style field, select any style.
-
Click Next > Next > Save.
The tab named Diagnostic Logs is created.
Perform the following steps to set the Tolerance value:
Log in to your Salesforce application.
Go to (Setup) > Setup.
In the Quick Find box, search for Custom Settings and click it.
Search for Diagnostic Settings and click it.
Click Manage > New.
-
Specify the following values in the respective fields:
Field Name Value Interest Amount Tolerance You can add the required value. For example, 10 or 20. Click Save.
Add the Diagnostic Status section
If you want to view the details of the Diagnostic Status, perform the following steps:
This step needs to be performed only when you are doing an upgrade to Spring'23 from a previous release. For a fresh installation of Spring'23, this section gets added automatically.
Log in to your Salesforce application.
Go to (Setup) > Setup.
Click Object Manager.
In the Quick Find box, search for CL Contract and click it.
Go to Page Layouts > Loan Account Layout.
-
Below the Quick Find search box, locate Section and drag it to the following area where you require.
-
In the Section Properties window that comes up, provide the following details, and then click Ok:
Field Name Action Section Name Enter Diagnostic Status Layout Select 1-Column Then go back to the left panel and click Visualforce Pages.
In the Quick Find search box, enter diagnosticSatusPage:
-
Drag the diagnosticSatusPage in the newly created Diagnostic Status section as highlighted in the following image:
Adjust the height of the page as you require by clicking the Visualforce Page (Properties), and then click Save.
Example to understand Interest Diagnostics
Example -1
Consider the following loan:
Loan Name |
Principal Paid |
Interest Paid |
Interest Remaining |
Interest Posted |
Adjusted Interest |
Adjusted Interest No Capitalized |
Fees Paid |
LAI-00001 |
170 |
50 |
20 |
0 |
0 |
0 |
0 |
Consider the following payments and interest calculations:
Time counting method = Months and days, Billing and IPT frequency = Monthly, Rate = 10%
Transaction Type |
Amount |
Transaction Date |
Interest Due |
Loan Balance |
Previous Balance |
Calculated Interest [Sum of all Interest calculated for each LAD block] Previous Interest + (Previous Balance * Previous Rate * Frequency / Time Counting method * 100) |
Disbursal |
$10,000 |
April 1 |
0 |
$10,000 |
0 |
Previous balance = 0, so interest will be 0 |
IPT |
$83.33 |
May 1 |
$83.33 |
$10,083.33 |
$10,000 |
0 + (10,000 * 10 * 30/36000 = 83.33) = $83.33 |
Bill |
$83.33 |
May 1 |
$83.33 |
$10,083.33 |
$10,000 |
0 + (10,000 *10 * 30/36000 = 83.33) = $83.33 |
Payment (Paid Only IPT) |
$83.33 |
May 10 (Current LAD) |
$28.00 (10 days interest) |
$10,000 |
$10,083.33 |
83.33 + (10,083.33 * 10 * 10/36000 = 28.00) - (paid interest = 83.33) = $28.00 |
Tolerance Value = 40
Actual Interest = 50 + 20 = $70
Calculated Interest = 83.33 + 28 = $111.33
Difference = (111.33 - 70) = $41.33
Difference is higher than tolerance value so the job logs an entry into the diagnostic object.
Example - 2
In case of capitalization, If loan Contract Date = January 1, payment dates are at the first of every month, and if Payment Frequency is Monthly, Capitalization date or posting date = first of every month if posting is at Billing Frequency.
Current System Date = April 15
Now, say, there is a change in rate then LAD is updated to April 15.
Last Interest Posting/capitalized date = April 1
Interest Remaining = Interest calculated for April 1 to April 15
Interest is calculated as follows:
Actual Interest (AI) = Interest Paid + Interest Posted + Interest Remaining
Expected Interest (EI) = Calculated interest till last accrual date, which is April 15
Following are the formulae used for calculating:
Capitalization Interest:
Actual Capitalized Interest (ACI) = Interest Paid (Capitalized Interest) + Interest Posted
Expected Capitalized Interest (ECI) = Calculated interest till last posting/capitalized date, which is April 1
Non-Capitalization Interest:
Actual Non-Capitalized Interest = AI - ACI
Expected Non-Capitalized Interest = EI - ECI
Example to understand Principal Balance Diagnostics
Let us say the following are the terms and conditions of a loan:
Loan Amount = $10,000
Current Principal Remaining = $4,000
Sum of all principal payments = $5,000
Then, expected principal remaining would be = $5,000
Diagnostic log gets generated where expected value is $5,000 and Aatual value = $4,000.
Diagnostic entry would look like this:
Diagnostic Type |
Loan Account |
Actual Value |
Calculated Value |
Principal |
LAI-0000001 |
$4,000 |
$5,000 |