hello, in netsuite some vendors have 3 addresses, ...
# ask-stanley-ai
m
hello, in netsuite some vendors have 3 addresses, is there a way we can run an import or mass delete for 3rd addresses? i saw the only option is to have a saved search pull the information and then delete
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that there are a few ways to mass delete addresses in NetSuite: 1. Saved Search and Online Edit: You can create a saved search that lists the addresses you want to delete. Then, use the online edit function to delete these records in bulk. However, this method might not be feasible if you have a large number of addresses to delete. 2. SuiteScript: You can write a SuiteScript to delete the addresses. Here is a sample script provided in the conversation:
Copy code
javascript
// 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;
} 

if (_changed == true)
    Rcustomer.save();
This script loads a customer record, iterates over the addressbook sublist, and removes each line. If any changes were made, it saves the customer record. 3. Custom Record and Script: Another method is to create a custom record, upload the internal IDs of the addresses you want to delete into it, and then write a script to delete the addresses based on the custom record. Remember to always test these methods in a sandbox environment before applying them to your live data. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842590392
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.84149158
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.838806152
Please provide your feedback on this answer.