hello, Does anyone have a code snippet that shows ...
# suitescript
h
hello, Does anyone have a code snippet that shows how to remove address line from a customer record in SS 2.0
e
Hard to say without more context, but in general you'd use Record.removeSublistSubrecord()
h
Thanks @Eric Charpentier do you have like code snipped to share.. I am actually using Record.removeCurrentSublistSubrecord...but any example would help
j
why don’t you share what you have so far and we can help? Would be quicker than someone else having to write your code from scratch for you
h
Copy code
record.load({type: 'customer', id: id, isDynamic: true}); rec.selectLine({sublistId: 'addressbook', line: j});
rec.removeCurrentSublistSubrecord({
    sublistId: 'addressbook',
    fieldId: 'addressbookaddress'
});
rec.commitLine({sublistId: 'addressbook'}); rec.save();
@jen @Eric Charpentier This is not working? this code is in server script...any ideas why?
m
Without getting overly technical, if you need to remove a certain subset of addresses, you can do so with a CSV Import in NetSuite.
h
I need to do it via script..
b
in the context of customer address lines, you want removeLine
you usually dont want the rest of the address line if you remove the address subrecord
💯 1