Aaron McCausland
10/13/2025, 7:18 PMCeligo AI
10/13/2025, 7:18 PMAI generated answer (using internal Slack threads):To get the behavior of the "Next Bill" button in a SuiteScript and have it follow Billing Schedules, you can use the
nlapiTransformRecord function. However, this function will bill the entire Sales Order (SO) regardless of the billing schedules attached.
To overcome this, you can set the billdate in your script. Unfortunately, there is no direct way to do this in a workflow.
Another approach is to pay attention to the URL parameters when you press the "Next Bill" button on your Sales Order. These parameters are default values that you need to set while transforming the invoice.
Here is a sample code snippet:
javascript
var record = nlapiTransformRecord('salesorder', salesOrderId, 'invoice');
record.setFieldValue('trandate', nextBillDate);
var invoiceId = nlapiSubmitRecord(record, true, true);
In this code, salesOrderId is the ID of the Sales Order you want to bill, and nextBillDate is the date of the next bill according to the billing schedule.
Please note that this is a simplified example and you may need to adjust it according to your specific requirements.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/13/2025, 7:18 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840515137
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.837646544
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836792052
Celigo AI
10/13/2025, 7:18 PMAaron McCausland
10/13/2025, 8:06 PM