Skip to content

Instantly share code, notes, and snippets.

@matthewpoer
Created October 31, 2014 06:33
Show Gist options
  • Save matthewpoer/ca8d648a8a86c86b259e to your computer and use it in GitHub Desktop.
Save matthewpoer/ca8d648a8a86c86b259e to your computer and use it in GitHub Desktop.
SugarCRM 6/7 customization to automatically check the Sync to Outlook checkbox for all Contacts and Users in the system. Skips inactive/reserved users (e.g. SNIP User) and any deleted records.
delete from contacts_users;
insert into contacts_users
(id,contact_id,user_id,date_modified,deleted)
select UUID(), contacts.id, users.id, now(), 0
from contacts, users
where users.deleted=0 and contacts.deleted=0
and users.status='Active';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment