hi i have this below parsed result {"subsidiarynoh...
# suitescript
v
hi i have this below parsed result {"subsidiarynohierarchy.CUSTRECORD_BOX_FULFILLMENT":{"value":"2","text":"Air Bm"}} Its a join on the saved search meaning ({name : 'subsidiarynohierarchy', join : 'CUSTRECORD_RFS_PACKED_BOX_FULFILLMENT'}) Now i want to take the value using below code log.debug('sub',searchResult.values['custrecord_box_fulfillment.subsidiarynohierarchy']); but it returns nothing. Could anyone please help me?
r
Please go through the search module and its object. Netsuite Object != the parsed object that you see in logs. Search Module: (See the column object parameters) https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_4345764122.html SuiteScript Example: (understand how to fetch the value for a column from a search row) https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_0304061100.html
v
its the result i get in the map function after parsed. is that you mean?
r
if its a parsed JSON. Then you can do it like this
Copy code
parsedJson={  "subsidiarynohierarchy.CUSTRECORD_BOX_FULFILLMENT": {
    "value": "2",
    "text": "Air Bm"
  }
}
myValue = parsedJson["subsidiarynohierarchy.CUSTRECORD_BOX_FULFILLMENT"]["value"]
v
this is the error i got TypeError: Cannot read property "subsidiarynohierarchy" from undefined
TypeError: Cannot read property "value" from undefined
r
can you please provide your script
v
you mean complete script?
r
yes at least the input and map stage
v
Thank you raghav I got it. now its working.