GMR Admin
04/01/2026, 5:44 PM// Set billing address from the customer's default billing address
const customerId = newRecord.getValue({fieldId: 'entity'});
if (customerId) {
const customerRecord = record.load({type: record.Type.CUSTOMER, id: customerId });
const addressCount = customerRecord.getLineCount({sublistId: 'addressbook'});
for (var i = 0; i < addressCount; i++) {
var defaultBilling = customerRecord.getSublistValue({sublistId: 'addressbook', fieldId: 'defaultbilling', line: i});
if (defaultBilling) {
const addressId = customerRecord.getSublistValue({sublistId: 'addressbook', fieldId: 'internalid', line: i});
newRecord.setValue({fieldId: 'billaddresslist', value: addressId});
break;
}
}
}battk
04/01/2026, 10:16 PMbilladdresslist without all the other code so that you can see the behaviour of setting the fieldbattk
04/01/2026, 10:17 PMbilladdress area text and not looking at the actual billingaddress subrecord. Its not unusual for user event scripts to not actually update the billaddress after changing the billing addressGMR Admin
04/02/2026, 11:21 PMbattk
04/02/2026, 11:24 PMbattk
04/02/2026, 11:25 PMGMR Admin
04/02/2026, 11:25 PMbattk
04/02/2026, 11:30 PMbattk
04/02/2026, 11:30 PMGMR Admin
04/02/2026, 11:30 PMbattk
04/02/2026, 11:30 PMGMR Admin
04/02/2026, 11:30 PMbattk
04/02/2026, 11:31 PMGMR Admin
04/02/2026, 11:31 PMGMR Admin
04/02/2026, 11:31 PMGMR Admin
04/02/2026, 11:32 PMGMR Admin
04/02/2026, 11:32 PMGMR Admin
04/02/2026, 11:33 PMbattk
04/02/2026, 11:33 PMGMR Admin
04/02/2026, 11:34 PMbattk
04/02/2026, 11:34 PMGMR Admin
04/02/2026, 11:35 PMbattk
04/02/2026, 11:37 PMbilladdressfield uses address book line ids as the values for select fieldsbattk
04/02/2026, 11:37 PMGMR Admin
04/02/2026, 11:38 PMGMR Admin
04/02/2026, 11:47 PMGMR Admin
04/02/2026, 11:56 PMbattk
04/02/2026, 11:59 PMGMR Admin
04/03/2026, 12:05 AMGMR Admin
04/03/2026, 12:05 AMGMR Admin
04/03/2026, 12:06 AMGMR Admin
04/03/2026, 12:07 AMbilladdresslist to the ID of the addressbook subrecord did update the select field but because it fires on fieldChanged it didn't do anything on save.GMR Admin
04/03/2026, 12:07 AMbattk
04/03/2026, 12:08 AM