PHP, SugarCRM, Javascript, Cool Web Apps Developer


Find out Email Related to Account/Contact

Posted by swapnil shinde on February 15, 2012 at 7:55 AM

As Email for all the modules which are derived from Person Template/Type will be stored in Email Module. We can access this email by finding out relationship between module and email module.

Suppose you want to find Contact's email and you have its id(generated by sugar) then you can use following query to find out the email.

"select email_address

from email_addresses e, email_addr_bean_rel ec

where bean_id = '$contact_id'

and ec.email_address_id =

and e.opt_out =0

and e.deleted =0

and ec.deleted =0"

Suppose you want to find out Account's or User's email you can just replace the contact id by account or user's id and get it.

Categories: Feb2012-SugarCRM Help

Post a Comment


Oops, you forgot something.


The words you entered did not match the given text. Please try again.

You must be a member to comment on this page. Sign In or Register