I've had to create my own "Address Machine" to support additional functionality not available in the built in system. I've hidden the NS Address tab and instead display my SuiteLet address system. This all works fine, although it's a bit messy it does the job.
The last piece of the puzzle is updating the 'defaultaddress' field on the entity record. Often my users will navigate to a customer record to check the address and they look at this field rather than the address list.
I have finally figured it out by using a VERY simple example that data written to this field isn't saved!
Here is the code I'm using to test:
function OnAfterSubmit(type) { var context = nlapiGetContext(); if(context.getExecutionContext() === SS_EXC_CONTEXT.UI && (type === RECORD_STATE.EDIT || type === RECORD_STATE.VIEW)) { // var record = nlapiGetNewRecord(); var record = nlapiLoadRecord(nlapiGetRecordType(), nlapiGetRecordId()); record.setFieldValue(ENTITY_FIELDS.ADDRESS, 'Steve Klettn350 N.nOrange, CA 92866'); nlapiSubmitRecord(record); log('saved record'); return; } } I do see that the field is "readonly" (has a dark background) but I'm not sure that means I can't write to it. I'm actually really surprised it's a database field at ALL! I would have hoped it would source from the address list but this doesn't seem to be the case.Anyone know why my changes to this field aren't being saved?