Results 1 to 6 of 6
Like Tree1Likes
  • 1 Post By Francescas

Thread: Find contact by email and add to emails_email_addr_rel table

  1. #1
    vasikgreif Guest

    Default Find contact by email and add to emails_email_addr_rel table

    Hi everybody,
    in my code I'm creating emails with user added email adresses. I would need to

    - check, if some contact has the email adress
    - if so, write the relationship to the emails_email_addr_rel table

    Any hints how to do this?

    Thanks

  2. #2
    vasikgreif Guest

    Default Re: Find contact by email and add to emails_email_addr_rel table

    Anyone knows how to do this one?

  3. #3
    ashdwi1's Avatar
    ashdwi1 is offline Sugar Community Member
    Join Date
    May 2008
    Location
    Noida
    Posts
    427

    Default Re: Find contact by email and add to emails_email_addr_rel table

    Quote Originally Posted by vasikgreif View Post
    Anyone knows how to do this one?
    Hi
    might you can try this

    For primary address
    $obj->emailAddress->getPrimaryAddress

    For all address
    $obj->emailAddress->getAddressesByGUID($id , $module)

    Let me know if that not works

  4. #4
    vasikgreif Guest

    Default Re: Find contact by email and add to emails_email_addr_rel table

    Thanks, but I think I need the other way around - I have email address and need to find an ID of contact with that address.

  5. #5
    Francescas's Avatar
    Francescas is offline Sugar Community Member
    Join Date
    Dec 2011
    Location
    Colorado
    Posts
    508

    Default Re: Find contact by email and add to emails_email_addr_rel table

    Quote Originally Posted by vasikgreif View Post
    Thanks, but I think I need the other way around - I have email address and need to find an ID of contact with that address.
    PHP Code:
       $contacts = array();
       
    $ea = new EmailAddress();
       
    $contacts $ea->getRelatedId($addr'Contacts'); 
    Will give you an array of contact Ids for all Contacts with that email address.
    where $addr is the email address you want to look up.

    Similarly
    PHP Code:
       $leads = array();
       
    $ea = new EmailAddress();
       
    $contacts $ea->getRelatedId($addr'Leads'); 
    will give you all Lead IDs for leads with that address
    vasikgreif likes this.
    Francesca
    =========
    SugarCRM Professional 6.5.15
    Linux
    Apache
    MySql
    PhP

  6. #6
    vasikgreif Guest

    Default Re: Find contact by email and add to emails_email_addr_rel table

    Thanks, works great!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 2013-09-11, 12:52 AM
  2. Linking one Contact to another using contacts_cstm table
    By gholt.gdevelop in forum Developer Help
    Replies: 2
    Last Post: 2011-04-08, 09:32 AM
  3. Replies: 0
    Last Post: 2010-11-12, 06:38 AM
  4. Replies: 0
    Last Post: 2010-11-11, 06:35 PM
  5. selected fields are not storing in the contact table
    By akil_123 in forum Developer Help
    Replies: 0
    Last Post: 2010-02-08, 08:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •