Charan
12/11/2024, 10:25 PMCeligo AI
12/11/2024, 10:25 PMAI generated answer (using internal Slack threads):To get the contacts attached to a partner using SuiteScript 2.1, you can use a saved search on the Contact record with a join on the Partner record. Here is a sample code snippet:
javascript
var contactSearch = search.create({
type: search.Type.CONTACT,
filters:
[
["company.internalid","anyof",partnerId]
],
columns:
[
search.createColumn({name: "firstname"}),
search.createColumn({name: "lastname"}),
search.createColumn({name: "phone"})
]
});
var searchResult = contactSearch.run().getRange(0, 100);
In this code, partnerId
is the internal ID of the partner record. The search will return all contacts associated with the partner, and for each contact, it will return the first name, last name, and phone number.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
12/11/2024, 10:25 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.852610171
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.851380527
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.83891207
Celigo AI
12/11/2024, 10:25 PM