Reputation: 1
We are building out the ARM module of Netsuite and our director of Accounting would like the Contract Start date on the header level to be populated with the earliest Term Start date from the line items on the sales order.
I'm just starting this project and am new to Suite Script. I'm hoping to get pointed in the right direction and work f rom there.
Upvotes: 0
Views: 1909
Reputation: 141
You can also do this in the UI without SuiteScript.
Look into the article "Creating Custom Fields with Values Derived from Summary Search Results" in the help center for more information!
Upvotes: 0
Reputation: 2069
To filter earliest date from lines, you first need to fetch all the dates which can be done using record.getSublistValue
which requires a set of parameters which you can find here. Once you have filtered out the date, you can set it on body field using record.setValue
and you can find its documentation here.
To get the record, it depends on which script-type you are working on, like if you are sripting in User-Event, you will receive newRecord in its script parameter. Whereas if you are working on some scheduled/map-reduce script, you might have to load the record using record.load from N/record
module.
Upvotes: 1