NetLoan - Automating Case Creation from a Payment Status
Overview
A payment status can automatically open a support Case (or update an existing one) when a loan enters it, so delinquent loans land in your support or collections queue without manual effort. You control which Case fields are populated through a Case JSON mapping on the status record. This article shows how to enable case creation or updates and how to build the Case JSON.
Prerequisites
- A custom payment status already exists. See NetLoan - Creating Custom Payment Statuses.
- A NetSuite role with administrator-level access to NetLoan Setup, and familiarity with the Case record's fields and their internal IDs.
- Someone comfortable writing JSON to build the field mapping. If you don't have that expertise in-house, Netgain can help or put you in touch with a partner who can build it for you.
- NetSuite's case management system must be turned on. Go to Setup > Company > Enable Features > CRM tab and, under Basic Features, enable Customer Support and Service. This switches on case records, assignment/routing rules, escalation, and territories. It's a NetSuite prerequisite you must complete before cases can be used.
- The loan's customer must have an email address on the customer record (see Considerations in Setup Options - case creation fails without one).
Setup Options
Navigation
- Top navigation: NetLoan > NetLoan Setup > NetLoan Payment Statuses, open the status you want to drive case creation.
Choose one of the two case actions on the status record, then supply the Case JSON.
Case action fields (NetLoan Payment Status record)
| Field Name | Field Type | Description | Dependencies | Options / Example | Field ID |
|---|---|---|---|---|---|
| Create Case | Checkbox | When a loan enters this status, creates a new Case. The script automatically sets the Case's Company to the loan's customer and links the loan via the Loan field, then applies your Case JSON. If no title is supplied in the JSON, it defaults to "Overdue Payment". | Case JSON | Checked | custrecord_da_pmt_status_create_case |
| Update Case | Checkbox | When a loan enters this status, updates the most recent open Case on the loan with your Case JSON. Primarily used on follow-on statuses that come after a status which created the initial case, so a case is guaranteed to exist to update. If the loan has no open case, the update is skipped and logged as an error. | Case JSON | Checked | custrecord_da_pmt_status_update_case |
| Case JSON | Textarea | A JSON object of Case field IDs to values, applied on create or update. For create, it layers on top of the auto-set Company and Loan fields. | Create Case or Update Case | See below | custrecord_da_pmt_status_case_json |
Use Create Case or Update Case, not both, on a single status.
How the loan links to the Case
On create, the script populates the Case's Loan field (custevent_da_case_loan) with the loan's internal ID, so every generated case is tied back to its loan. You don't need to include this in your JSON.
Building the Case JSON
The Case JSON is a flat object whose keys are Case field internal IDs and whose values are what to set. Find a field's internal ID under Setup > Records Catalog, which is the easiest place to browse the Case record's fields. Example:
{
"title": "Loan 30+ Days Past Due",
"priority": "HIGH",
"category": "3",
"custevent_collections_tier": "Past Due"
}
- Text fields take a string (
"title"). - List/record fields take the internal ID of the option as a string (
"category": "3"). - Leave company and the Loan field out - they're set automatically on create.
Considerations
The most common failure is a missing email address. NetSuite's Case record can reject creation with "Please enter an email address if you want to email the reply" when the associated customer has no email. When a case fails to create, the script writes the error message onto the loan record so you can see why. Add an email address to the customer to resolve it.
For Update Case, there must already be an open case on the loan; otherwise nothing is updated. Pair an initial Create Case status with later Update Case statuses so there's always a case to update.
Use Case Specific Setup
Use Case: Open a collections case at 30 days past due
On a "Past Due" status (Parent Status = In Arrears, Days Overdue = 30):
| Field | Setting | Notes |
|---|---|---|
| Create Case | Checked | Opens a new case when the loan hits this status |
| Case JSON | {"title":"Loan 30+ Days Past Due","priority":"HIGH"} | Company and Loan are set automatically |
Use Case: Escalate the existing case at 60 days
On a more severe status (Days Overdue = 60), update the case opened earlier rather than creating a duplicate:
| Field | Setting | Notes |
|---|---|---|
| Update Case | Checked | Updates the most recent open case on the loan |
| Case JSON | {"priority":"HIGH","custevent_collections_tier":"Serious Delinquency"} | Requires an open case to exist |
