Has anyone used SuiteScript to add a line item to ...
# suitescript
c
Has anyone used SuiteScript to add a line item to a Sales Order and had the Contracts Renewal Bundle automatically populate the Contract Item Term field on the new line item? I'm adding a new item to an existing SO but that field is not being populated. I don't want to re-create the NetSuite formula for calculating that value as it's complex and looks like a source of constant issues. This is the formula the bundle uses if anyones interested: https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4582083020.html
a
I'm confused, if you have the bundle installed wouldn't that be triggering this calculation?
c
For CSV imported lines, it is.
For lines added via SS, it is not.
I matched the fields from the CSV 1:1 with the fields I am setting in the script. Still no calculation.
a
try loading the SO in dynamic mode?
c
Good point, I'll give that a go.
a
you'll have to change all your sublist code to use selectLine first and then the "current" versions of the apis without the line parameter
👍 1
c
Dynamic mode made no difference, the Contract Item Term is still not populated.
I'm adding a new line in a Map/Reduce script, I wonder if the Contract Renewal Bundle scripts are just not being triggered.
I'm tempted to create a CSV in the script and import that. CSV imports seems to trigger the term calculation.
I decided to implement the math from the NetSuite docs to calculate decimal terms in months. I hope NS never change their method 🙂
😂 1