Bruce Backman
05/06/2026, 2:45 PMCeligo AI
05/06/2026, 2:46 PMAI generated answer (using internal Slack threads):To retrieve a salesorder's Primary Contact through the REST API, you would need to perform a search operation on the salesorder. In the search criteria, you would use the
Contact (Primary) join to get the primary contact associated with the salesorder.
Here is a general example of how you might structure your search operation:
javascript
var mySearch = search.create({
type: "salesorder",
filters:
[
["mainline","is",true]
],
columns:
[
search.createColumn({name: "entityid", join: "Contact (Primary)"})
]
});
var searchResult = mySearch.run().getRange(0, 100);
In this example, the Contact (Primary) join is used to retrieve the primary contact's entity ID. You can modify this to retrieve other fields from the primary contact as needed.
Please note that this is a general example and may need to be adjusted to fit your specific use case. Also, remember that the REST API may have different syntax or methods for creating and executing searches.
******
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
05/06/2026, 2:46 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865234435
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.836731
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.827392638
Celigo AI
05/06/2026, 2:46 PMCeligo AI
05/06/2026, 2:53 PM