sync contacts: sql select from crm_contact, crm_contact_info

Post Reply
segro
Posts: 1
Joined: Wed Jan 31, 2018 10:34 pm

sync contacts: sql select from crm_contact, crm_contact_info

Post by segro » Mon Apr 15, 2019 9:25 am

hi @all,
** I KNOW YOU've GOT AN API ** but:
I need a mysql selct to join all contacts with contact deatils to push that in a ldap-addressbook. we used sugarcrm before and there i simply did:

Code: Select all

SELECT contacts.id AS id, contacts.first_name AS givenName,contacts.last_name AS sn,contacts.last_name AS cn ,accounts.name AS o,
        primary_address_street AS street,primary_address_postalcode AS postalCode, primary_address_city AS l,
        contacts.phone_work AS telephoneNumber,contacts.phone_mobile AS mobile, email_addresses.email_address AS mail
FROM contacts
        INNER JOIN accounts_contacts ON accounts_contacts.contact_id = contacts.id AND accounts_contacts.deleted=0
        INNER JOIN accounts ON accounts.id = accounts_contacts.account_id AND accounts.deleted=0
        LEFT JOIN email_addr_bean_rel eabr ON eabr.bean_id = contacts.id AND eabr.deleted=0 AND eabr.bean_module='Contacts'
        LEFT JOIN email_addresses ON email_addresses.id = eabr.email_address_id AND email_addresses.deleted=0
can anybody tell me how to get similar results from crm_contact, crm_contact_info in onlyoffice?
Thank you for any hints...

Post Reply