<@U017Q34GFPV> It looks like you'll need to access...
# suitescript
k
@Bibek Shrestha It looks like you'll need to access the contacts as a sublist on the customer. Generally, I'd recommend using a search with the opportunity. But it does work like this if you have the customer loaded:
Copy code
var myContact = CustomerRecord.getSublistValue({ sublistId: 'contactroles', fieldId: 'contact', line: 0 });
b
Wouldn’t this give me contacts related to the customer and not the opportunity?
e
It would. You could take the same approach on the Opportunity record though. You can use .getSublistValue to get a value from the sublist rather than .getSublist
b
I already tried
.getSublistValue
,
.getSublist
,
.getLineCount
None of them work Strangely
.getSublists
lists
contacts
as one of the sublists
e
Hmmm. I'm seeing the same. Is the list of Contacts on your Opportunity different than the list of Contacts on the Customer Record?
b
yup
Those contacts are added in the Opportunity directly
e
So is there any reason you couldn't get the list of contacts from the Customer record and not from the Opp?
b
as I said.. they are different
e
My apologizes, I read your response wrong
b
no worries on that
@kenofthenorth I tried using the search with Opportunity type but wasn’t able to get anything. Maybe I’m doing something wrong as I’m not used to with search module.
k
In the example I looked at on my end, there was no difference between the contact list on the customer versus the opportunity. For a search, I like to try to get the search to work in the User Interface, and then export it using this extension: https://chrome.google.com/webstore/detail/netsuite-saved-search-exp/cbpefhoehnbljgflflncaejfmkmofoje?hl=en-US
👍 1
b
Thanks for the plugin..
@kenofthenorth That helped and I was able to resolve the issue. Thanks a lot
k
Glad to hear it!