Anyone who has encountered an issue on a transacti...
# suitescript
j
Anyone who has encountered an issue on a transaction shipping address inconsistency? I am getting different results from getValue and getSubrecord for shipping address.
Copy code
require(['N'], function(N) {
for(var n in N){window[n] = N[n];};
try{


var customerRec = record.load({
    type: record.Type.SALES_ORDER, 
    id: 55482,
    isDynamic: true
});
var id  = customerRec.getValue('shipaddresslist')
var subrecOldShippingAddress = customerRec.getSubrecord({
    fieldId: 'shippingaddress'
});
var id2 = subrecOldShippingAddress.getValue('id') || '';
} catch(e){console.error(e.message);}})
s
I don't have specific examples, but I've learned to not trust the body level address related fields. My attempt at consistency is I pretend the body fields don't exist and exclusively use the subrecord
b
there are 2 ids associated with addresses
the id of the addressbook line, and the id of the address subrecord
the ship to select uses the addresbook line id
the id of the subrecord is the address subrecord's id