NetLoan - API End Points


Use Case: NetLoan is built off of native NetSuite custom records, so many updates to loan records can be facilitated by utilizing REST calls to NetSuite RESTlets and writing those updates in SuiteScript. There are however, many batch jobs that are available inside of NetLoan that many need to be called (e.g. schedule generation). This article serves to show the best way to run those jobs.

Scheduled Jobs

Netgain has a Map/Reduce script specifically dedicated to scheduling batch process jobs. Navigate to Customization > Scripting > Scripts, view the "NetLoan - Automate Jobs MR" script, and click on the "Deployments" subtab - you should see the following:

Netgain has these deployments set NOT to be updated with bundle upgrades so any of the out-of-the-box deployments can be edited and scheduled to run on a recurring basis. To do so, click the link to the deployment, click Edit, and update the Status field from "Not Scheduled" to "Scheduled", then update the details of how often you want the job to run on the Schedule subtab:

To narrow down the number of loans the job runs on, replace the Saved Search used on the Parameters subtab for a search with more refined filters -> saving the existing search as is always a good place to start. 

Ad-Hoc Jobs

A few jobs that are used more frequently can be called directly via the SuiteScript API. Here are a few that have been made available:

  • NetLoan - Schedule MR
    • Purpose
      • Initial Schedule Generation
      • Update schedules for loans with new payments, rates, or approved modification proposals
    • Example
            var objMapReduceTask = task.create({
                taskType: task.TaskType.MAP_REDUCE,
                scriptId: 'customscript_da_schedule_mr',
                deploymentId: '',
                params: {
                    'custscript_da_schedule_parameter': {
                        'loans': ARRAY_LOAN_INTERNAL_IDS, //If calling for a set of individual loans 
                        'searchId': SAVED_SEARCH_INTERNAL_ID, //If using a saved search to isolate loans
                        'auto_mod': true, //Set to true if the intention is to update the schedule on a commenced loan
                        'auto_commence': false, //Set to true if you would like to commence the loan after schedule generation
                    },
                },
            });
            objMapReduceTask.submit();
  • NetLoan - Commence MR
    • Purpose
      • Update the status of loans from Pending to Commenced
    • Example
            var objMapReduceTask = task.create({
                taskType: task.TaskType.MAP_REDUCE,
                scriptId: 'customscript_da_commence_mr',
                deploymentId: '',
                params: {
                    'custscript_da_commence_parameter': {
                        'loans': ARRAY_LOAN_INTERNAL_IDS, //If calling for a set of individual loans 
                        'searchId': SAVED_SEARCH_INTERNAL_ID, //If using a saved search to isolate loans
                    },
                },
            });
            objMapReduceTask.submit();
  • Reach out if you think a script should have its endpoints made available



Was this article helpful?