How do you bring back the Value of a Joined column...
# suitescript
w
How do you bring back the Value of a Joined column when using search.lookupFields
Copy code
var fieldLookUp = search.lookupFields({
    type: search.Type.SALES_ORDER,
    id: transactionID,
    columns: ['location', 'shippingAddress.internalid']
});

console.log(fieldLookUp.location[0].value); //This works for location
console.log(fieldLookUp.shippingAddress.internalid[0].value); //this doesn't work. 

Here is what the fieldLookUp contains
 {
"location": [
                {
                    "value": "2",
                    "text": "FR-NB"
                }
            ],
"shippingAddress.internalid": [
                {
                    "value": "218061",
                    "text": "218061"
                }}
n
const shippingId = fieldLookup['shippingAddress.internalid'][0].value
If you notice the key is the full string including the dot. so the key is "shippingAddress.internalid" What you tried was referencing the key internalid inside an object called shippingAddress.
☝️ 1
With strings that include a period you reference them with square brackets instead of dot notation
w
@Nathan L Fantastic. I knew something was off. I tried something very close to that. Thank you very much. I'm back in business.
apartyblob 1