Aaron McCausland
05/14/2025, 9:11 PMCeligo AI
05/14/2025, 9:11 PMAI generated answer (using internal Slack threads):To create an address subrecord on a Customer's address book using SuiteScript, you can use the
getSublistSubrecord
method. Here is a sample code snippet:
javascript
var customerRecord = record.load({
type: record.Type.CUSTOMER,
id: 'customer_id'
});
var addressSubRec = customerRecord.getSublistSubrecord({
sublistId: 'addressbook',
fieldId: 'addressbookaddress',
line: 0
});
// Set the values for the address fields
addressSubRec.setValue({
fieldId: 'addr1',
value: '123 Main St'
});
addressSubRec.setValue({
fieldId: 'city',
value: 'Anytown'
});
addressSubRec.setValue({
fieldId: 'state',
value: 'CA'
});
addressSubRec.setValue({
fieldId: 'zip',
value: '12345'
});
// Save the record
var customerId = customerRecord.save();
In this example, we're loading a customer record, getting the address subrecord from the 'addressbook' sublist, and then setting the values for the address fields. Finally, we're saving the customer record.
Remember to replace 'customer_id'
with the actual ID of the customer you want to update.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
05/14/2025, 9:12 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.876537621
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.870489597
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.862351298
Celigo AI
05/14/2025, 9:12 PM