sorry for the newbie question but i cannot make it...
# suitescript
m
sorry for the newbie question but i cannot make it work. I am creating a new customer and populating fields from a parent customer. For this new customer I need to add a new address and when I try to do it in the before submit, using the context.newRecord, i get an error saying Please enter value for Address. What I try to do is this
const line = 0;
currentRecord.insertLine({
sublistId: "addressbook",
line: line,
});
currentRecord.setSublistValue({
sublistId: "addressbook",
fieldId: "defaultbilling",
value: true,
line: line,
});
currentRecord.setSublistValue({
sublistId: "addressbook",
fieldId: "defaultshipping",
value: defaultshipping,
line: line,
});
currentRecord.setSublistValue({
sublistId: "addressbook",
fieldId: "isresidential",
value: false,
line: line,
});
const subrec = rec.getSublistSubrecord({
sublistId: "addressbook",
fieldId: "addressbookaddress",
line: line,
});
subrec.setValue({
fieldId: "addr1",
value: "test 1",
});
b
dont use insertLine
set the country first