chicks / sugarcrm

A ruby based REST Client for SugarCRM
MIT License
90 stars 64 forks source link

Get Activity, History for Contact #76

Open cypriss opened 12 years ago

cypriss commented 12 years ago

Is there a way to get the Activity and/or History for a Contact with a single API call?

Activities can include Tasks, Emails, Calls, and Meetings, and History can include Notes / Attachments + Archived Emails.

I want to make 1 or 2 calls to get this information instead of getting each thing individually. Is this possible?

chicks commented 12 years ago

There should be, but let me tinker around a bit and see. This SEEMS similar in scope to retrieving email addresses for a given record, but I'm not sure.

FYI... Here's how we trick the REST API into giving us emails related to a record (we use a subquery). The example subquery is below:

SugarCRM.connection.get_entry_list(
  "Contacts",
  "contacts.id IN (SELECT bean_id FROM email_addr_bean_rel eabr JOIN email_addresses ea ON (eabr.email_address_id = ea.id) WHERE bean_module = 'Contacts' AND ea.email_address_caps LIKE '%SUGARCRM.COM' AND eabr.deleted=0)"
)
wutanghax0r commented 11 years ago

Any update on this? I would like to retrieve all emails related to a module (the ones that show up when I click "view summary" from the history subpanel.