csv imported some incorrect addresses. is there a...
# general
l
csv imported some incorrect addresses. is there a way to mass delete them?
i
haven't done it personally, but it looks like their is SA: 4115
🙏 1
s
I wrote a script to do it. You can adapt it for SO // Delete Addresses var Rcustomer = record.load({type: record.Type.CUSTOMER,id: _custid,isDynamic: true}); var line_count = Rcustomer.getLineCount({sublistId: 'addressbook'}) - 1; var _changed = false; for (kk=line_count;kk>-1;--kk) { Rcustomer.selectLine({sublistId: 'addressbook',line: kk}); var Raddress = Rcustomer.getCurrentSublistSubrecord({ sublistId: "addressbook", fieldId: "addressbookaddress" }); var _city=Raddress.getValue({fieldId: 'city'}); Rcustomer.removeLine({sublistId: 'addressbook',line: kk,ignoreRecalc: true}); _changed = true; } //for(var kk=0;kk<line_count;kk++){ if (_changed == true) Rcustomer.save();
🙏 1