SuiteQL query to get company contacts

The SuiteQL query below returns all of the contacts associated with a specified company.

SELECT
	Company.ID AS Company,
	Company.EntityTitle AS CompanyName,
	CompanyContactRelationship.Contact,
	BUILTIN.DF( CompanyContactRelationship.Contact ) AS ContactName,
	CompanyContactRelationship.Role,
	BUILTIN.DF( CompanyContactRelationship.Role ) AS RoleName
FROM
	Entity AS Company
	INNER JOIN CompanyContactRelationship ON
		( CompanyContactRelationship.Company = Company.ID )
WHERE
	( Company.ID = 2707 )

Leave a comment

Your email address will not be published. Required fields are marked *