how do i set the billing and shipping through rest...
# suitescript
r
how do i set the billing and shipping through restlet on customer? i have gotten the JSON i just dont understand the api i am confused a bit
1
w
The addresses on a customer are stored as a sublist subrecord. You set the default billing/shipping flags on the sublist while the subrecord contains the actual address. You typically only access subrecords via the parent record.
r
Record.getCurrentSublistSubrecord(options) so i use this?
w
You need to use the SublistSubrecord methods for the address body and the sublist methods for the metadata. So to make an address line default billing something like:
myCustomerRecord.setSublistValue({sublist : "addressbook", line : 123, fieldId: "defaultbilling", value : true})
r
yes right but how do i set the subrecord values?
do i directly set it ? but how
w
There is an example in suiteanswers that shows the pattern to use https://netsuite.custhelp.com/app/answers/detail/a_id/93003/
r
Yes thank you got it