I am trying to get a client subsidiary using searc...
# suitescript
p
I am trying to get a client subsidiary using search.lookupFields using the below code:
Copy code
var clientSub = search.lookupFields({
type: "customer",
id: clientId,
columns: "subsidiary"
});
log.debug('Client Subsidiary is ',clientSub)
When I check the log I get the following:
Copy code
{
  "subsidiary": [
    {
      "value": "3",
      "text": "ABC Company"
    }
  ]
}
How can I just get the value of the subsidiary?
c
if you just want the first one it's
clientSub.subsidiary[0].text
and
clientSub.subsidiary[0].value
otherwise, use your favourite iterator
p
Thanks!