Silly question i have this response from a saved s...
# suitescript
m
Silly question i have this response from a saved search
{
"recordType" : "purchaseorder",
"id" : "11111",
"values" : {
"tranid": "SFO11111",
"vendor.internalid": [
"value": "closed",
"text": "Closed"
]
....
}
how do I access vendor.internalid ?? I tried result.getValue(“vendor.internalid”) but it does not work
e
result.getValue({ name: “vendor” }) or getValue(columnObj) will do it. the internal ID is the “Value” and getText would return the Name of the Vendor record
m
thanks a lot
e
oh, you are looking at a status field of some sort. In that case, the value is “closed” and the text is “Closed”
b
You could also try parsing that using .toJSON() and accessing properties the native JS way.
e
sorry, I was off there. Definitely columnObj is one way, or { name: ‘’, join: ‘’ } (which is the equivalent)
m
it is a joined field
search.createColumn({
name: "internalid",
join: "vendor",
label: "vendorId"
}
i wanted to obtain the internal id from the vendor
n
May need to Join on the Result
Copy code
result.getValue({
    name: "internalid",
    join: "vendor"
})
🙌 1
m
excellent! this is what i needed, thank you