I need to update address record for each Employee ...
# suitescript
z
I need to update address record for each Employee and set label=home ... Any idea how to realize that?
b
wrong wording, the label is part of the addressbook sublist
not the address subrecord
z
@battk thx for clarifying .. something like this... map/reduce get all Employee...map stage setSublistValue......?
Copy code
var rec = record.load({
        type: record.Type.CUSTOMER,
        id: customer_id,
        isDynamic: false
    });

    /**
    * Modify those fields present in the Address sublist lines
    */
    rec.setSublistValue({
        sublistId: 'addressbook',
        fieldId: 'label',
        value: label,
        line: line
    });