class Infopark::Crm::Activity

Public Instance Methods

account() click to toggle source

Queries the WebCRM for the Account with the id account_id. @return [Infopark::Crm::Account] The account associated with this activity, if account_id is present. @webcrm_rest_url GET /api/accounts/account_id

# File lib/crm_connector/activity.rb, line 51
def account
  Infopark::Crm::Account.find(account_id) if account_id
end
contact() click to toggle source

Queries the WebCRM for the Contact with the id contact_id. @return [Infopark::Crm::Contact] The contact associated with this activity, if contact_id is present. @webcrm_rest_url GET /api/contacts/contact_id

# File lib/crm_connector/activity.rb, line 43
def contact
  Infopark::Crm::Contact.find(contact_id) if contact_id
end
custom_type() click to toggle source

Queries the WebCRM for the CustomType with the id kind. @return [Infopark::Crm::CustomType] The custom type associated with this activity, if kind is present. @webcrm_rest_url GET /api/custom_types/kind

# File lib/crm_connector/activity.rb, line 59
def custom_type
  Infopark::Crm::CustomType.find(kind) if kind
end
unknown() click to toggle source

@!method self.search(input) Searches for activities @param input [Hash] A hash containing a params key. The value of this key is a hash containing the actual search query. @return [Array<Infopark::Crm::Activity>] @webcrm_rest_url GET /api/activities/search @example

results = Infopark::Crm::Activity.search(:params => {:state => 'created'})
results = Infopark::Crm::Activity.search(:params => {:kind => 'support-case'})
results = Infopark::Crm::Activity.search(:params => {:contact_id => cid})
results = Infopark::Crm::Activity.search(:params => {:account_id => aid})
results = Infopark::Crm::Activity.search(:params => {:q => 'full-text search'})
# File lib/crm_connector/activity.rb, line 18
has_search

self.schema = {
  :account_id => :string,
  :appointment_contact_id => :string,
  :appointment_dtend_at => :time,
  :appointment_dtstart_at => :time,
  :appointment_location => :string,
  :comment_notes => :string,
  :comment_attachments => :array,
  :comment_published => :boolean,
  :contact_id => :string,
  :email_cc => :string,
  :kind => :string,
  :state => :string,
  :tags => :array,
  :task_due_at => :time,
  :task_owner_id => :string,
  :title => :string,
}