hello everyone, I am having issues accessing a val...
# suitescript
k
hello everyone, I am having issues accessing a value from the result of my context in the reduce stage of a MapReduce Script. The context that is passed on to the reduce stage looks like this
Copy code
var result = {
  "recordType":"salesorder",
  "id":"1234",
  "values":{
    "tranid":"678",
    "companyname":"ABC",
    "internalid.customerMain":{"value":"987","text":"987"}
  }
}
I am trying to access i`nternalid.customerMain` by doing this
var customer_id = result.values.internalid.customerMain.value
. However, I keep on getting this error
TypeError: Cannot read property "value" from undefined
. The same thing happens if I try
text
instead of
value
. Can someone help me whats wrong with the code?
s
Is that a Join search result? if it is You should get it like this
internalid = result.getValue({name: 'internalid', join: 'Customer'});