I have a Client Script that runs on a Sales Order....
# suitescript
n
I have a Client Script that runs on a Sales Order. Despite the Location field having a value I cannot seem to access it via script. I've tried,
Copy code
log.debug("record.location.field", currentRecordModule.get().getField({ fieldId: "location" }) );
//{"id":"location","label":"","type":"text","isMandatory":false,"isDisabled":false,"isPopup":false,"isDisplay":false,"isVisible":false,"isReadOnly":false}

log.debug("record.location.value", currentRecordModule.get().getValue({ fieldId: "location" }) );
// Logs nothing, blank
I'm not sure why the
getField
Log shows
"isDisplay": false,
since the field is visible.
Alternatively,
Copy code
log.debug("record.subsidiary.value", currentRecordModule.get().getValue({ fieldId: "subsidiary" }) );
logs correctly and seems to be just fine?
b
are you sure its the location field and not another field with a location label
n
yes, checked id, and xml
b
my guess is that you are doing this on a view, in which case most of the fields on the sales orders orders are unavailable
👍 1
lookup the values instead
n
thanks