NetLoan - Collections Scripts and Scheduled Jobs
Overview
The Collections module is driven by a couple of user event scripts on the loan and bill records, plus a scheduled job that assigns payment statuses, runs status-driven actions, and refreshes as-of-date figures. The scheduled work runs through NetLoan's Automate Jobs script, which ships with ready-made deployments for Collections - you pick the one that fits and confirm a few parameters rather than building a job from scratch. This article covers the scripts involved and the shipped deployments you should use.
Prerequisites
- The Collections feature is enabled. See NetLoan - Enabling Collections and How Payment Statuses Work.
- Administrator access to NetSuite Scripts and Script Deployments (Customization > Scripting).
Setup Options
Scripts involved in Collections
| Script | Type | Role |
|---|---|---|
| NetLoan - Loan UE (da-loan-ue.js) | User Event | On the loan record: when Collections is on, displays the collections banner/button; on commencement, sets the loan's Payment Status to Current. |
| NetLoan - Bill UE (da-bill-ue.js) | User Event | Updates the loan with actual billed and paid G/L information, which feeds the overdue and payoff calculations. |
| NetLoan - Collections MR (da-collections-mr.js) | Map/Reduce | The collections engine. Assigns each loan its payment status and, on a status change, runs the loan-update, case, and fee actions. When run with Update As Of Date on, it also refreshes the As-Of-Date / management-summary fields (payoff, overdue balances). |
| NetLoan - Automate Jobs (da-automate-job-mr.js) | Map/Reduce | The scheduler that runs the Collections MR. The deployments below are deployments of this script, pre-pointed at the Collections MR. |
Shipped deployments for Collections
NetLoan ships three deployments that run the Collections MR. Pick the one that matches how you want collections to run:
| Deployment | Deployment ID | What it does | When to use it |
|---|---|---|---|
| NetLoan - Automatic Loan Management Summary Reporting + Collections MR | customdeploy_da_auto_mgmt_summary_mr | Runs the Collections MR with Update As Of Date on - assigns statuses, runs status actions, and refreshes the as-of/management-summary fields (payoff, overdue) across loans. | The recommended single nightly job for most accounts, since it keeps statuses and as-of figures current in one run. |
| NetLoan - Automatic Collections MR (Scheduled) | customdeploy_da_sched_auto_collect_mr | Runs the Collections MR on a recurring schedule to assign statuses and run status actions, without the as-of refresh. | When you want collections processing on its own schedule and handle the as-of refresh separately. |
| NetLoan - Automatic Collections MR | customdeploy_da_auto_collections_mr | A Collections MR run that isn't on its own recurring schedule - intended to be triggered, such as chained after another job via the Next Job parameter. | When you chain collections to run after another process (e.g., after schedule generation). |
Use one of these; you don't need to create a new deployment. Chnage the status of the chosen deployment and confirm its schedule and parameters below.
Navigation
- Find/edit a deployment: Customization > Scripting > Script Deployments, then filter by the deployment ID, or open NetLoan - Automate Jobs under Scripts and use its Deployments subtab.
Parameters to confirm
The shipped deployments come pointed at the Collections MR (and, for the management-summary one, with Update As Of Date already on), so most accounts only need to confirm a few things:
| Parameter (function) | Why it matters | Field ID |
|---|---|---|
| Update As Of Date | Determines whether the run also refreshes payoff and overdue fields. On for the management-summary deployment; off for the collections-only deployments. | custscript_da_automated_job_as_of_date |
| Next Job | The deployment to run automatically when this one finishes. Use it to sequence jobs (e.g., run collections after schedule generation) so they don't collide. | custscript_da_automated_job_next_job_id |
| Status / Schedule | Native deployment fields. Set the deployment to scheduled and choose the recurrence (nightly out of the box) that fits your needs. | (deployment record) |
| Allow Concurrent Processing | Whether this job may run alongside another automated job. Leave default unless you have a specific reason to change it. | custscript_da_automated_job_concrt_proc |
Avoiding job collisions
NetSuite won't run two automated jobs at the same time. Rather than scheduling multiple collections deployments at nearby times and hoping they don't overlap, chain them with the Next Job parameter so each kicks off the next when it finishes. If you only run the management-summary deployment, there's nothing to collide with.
Use Case Specific Setup
Use Case: One nightly job for statuses and as-of figures
Most accounts only need the combined deployment:
| Setting | Value | Notes |
|---|---|---|
| Deployment | NetLoan - Automatic Loan Management Summary Reporting + Collections MR | customdeploy_da_auto_mgmt_summary_mr |
| Update As Of Date | On | Refreshes payoff/overdue alongside status assignment |
| Schedule | Nightly | Adjust recurrence as needed |
| Other collections deployments | Not scheduled | Avoids overlapping runs |
Use Case: Run collections after schedule generation
When schedules and auto-mods should be brought current first:
| Setting | Value | Notes |
|---|---|---|
| Scheduled job | Schedule generation / auto-mods deployment | Set its Next Job to a collections deployment |
| Collections deployment | NetLoan - Automatic Collections MR (customdeploy_da_auto_collections_mr) | Triggered by the prior job rather than its own schedule |
