+ Start a Discussion
David Herrero 5David Herrero 5 

Account Contact Relationship API

I would like to validate if an account is in the Account Contact Relationship object. I can't find the Account Contact Relationship  API name.
As it is not possible to do it with the Lookup filter criteria, I 'd like to do in the trigger, but I am begining to think this is not possible neither.

Any tip with this issue?

Hi David,

In the trigger, use the below SOQL to check whether the account is already related with a contact.

Integer count = [select count() from contact where accountid='1234567678990'];
system.debug('This account already has a relationship with a contact');

Hope this solves your problem. Let me know the feedback. Dont forget to hit that thumbsup button if it solves your issue.

David Herrero 5David Herrero 5
Hi Zaja, thanks for your response but this is not what I need.
I need to know if an account is in the Account Contact Relationship object (new object from the past year)
Now it is possible to include one contact in up to 800 accounts, and I want to check if one account is between the related accounts of a contact.

Thank you anyway