How to lookupFields for select and multiselect fields in suitescript 2.0

Hi All,

In this post we are talking about how to access fields using lookupFields.
We already discussed for normal field here

When we use lookupFields in 2.0 , we get field values in form of object/array.
If we access multi-select/ select fields using internal id , we will get value as Object Object.

Use field id as array and then get use value to access like below:


var customerCategoryFieldLookUp = search.lookupFields({
  type:'CUSTOMER' ,
  id: 121,
  columns: ['custentity_cseg_customer_categ']
});

customerCategoryFieldLookUp.custentity_cseg_customer_categ[0].value


** Here custentity_cseg_customer_categ is select field.
Do Not Forget to use validation and try catch as empty
"customerCategoryFieldLookUp.custentity_cseg_customer_categ" will cause error while accessing 0th value.


I hope this will help , please let us know if you have any issue.

Thanks
Netsuite Guru









Download Netsuite Guru Android App
Follow Me on Linkedin
Our FB Page

Comments