Sales Order – Suitescript to get attached contacts of salesorder

I have attached  3 contacts to a Sales Order from UI.  There is Contacts sub list under Relationships tab. I have selected contact from Contact List, attached the contact with sales order by clicking Attach button.  I want to retrieve the first name, last name phone of the first contact of the sales order using suitescript.

Sales Order  - Suitescript to get attached contacts of salesorder

Any help would be appreciated.

Rookie Asked on March 1, 2021 in SuiteScript.
Add Comment
2 Answer(s)

I know that it has been answered in the Slack channel, but it’s better to have the solution here as well.

We need to create a “Contact” saved search joined with Transaction, like that:

RE: Sales Order  - Suitescript to get attached contacts of salesorder

Rookie Answered on April 22, 2021.
Add Comment

And to use it in the script:

const savedSearch = search.load({id: <savedSearchId>});
savedSearch.filters.push(search.createFilter({name: 'internalid', operator: search.Operator.ANYOF, values: <salesOrderId>, join: 'transaction'}));
Rookie Answered on April 23, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor