Discussions
SuiteScript: Script stopped running after SuiteBilling Installation
I have a script that runs on the Sales order after submit, that updates the lines to have a 50% billing schedule on the. This code has worked fine without any issues but we have just installed SuiteBilling and now my code does not work anymore. Any ideas why this might be?
//Find out how many line items there are
var salesorderitems = (loadrec.getLineCount({sublistId: 'item'}))
//Loop through each line item on the Sales Order
//Set counter
var counter = 0
while (counter < salesorderitems){
loadrec.selectLine({sublistId:'item',line: counter})
loadrec.setCurrentSublistValue({
sublistId:'item',
fieldId: 'billingschedule',
value: 9
})
loadrec.commitLine({sublistId:'item'})
counter ++
}