Sha256: 1a579a29c9e4eb83d73aa1addf9761456eee18063d573fb16fc28597b7f28bfc

Contents?: true

Size: 1008 Bytes

Versions: 2

Compression:

Stored size: 1008 Bytes

Contents

module SugarCRM; class Connection
  # Retrieve a list of SugarBeans.  This is the primary method for getting 
  # a list of SugarBeans using the REST API.
  def get_entry_list(module_name, query, opts={})
    login! unless logged_in?
    options = {
      :order_by => '', 
      :offset => '', 
      :fields => [], 
      :link_fields => [], 
      :limit => '', 
      :deleted => 0
    }.merge! opts

    json = <<-EOF
      {
        \"session\": \"#{@session}\"\,
        \"module_name\": \"#{module_name}\"\,
        \"query\": \"#{query}\"\,
        \"order_by\": \"#{options[:order_by]}\"\,
        \"offset\": \"#{options[:offset]}\"\,
        \"select_fields\": #{resolve_fields(module_name, options[:fields])}\,
        \"link_name_to_fields_array\": #{options[:link_fields].to_json}\,
        \"max_results\": \"#{options[:limit]}\"\,
        \"deleted\": #{options[:deleted]}
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    SugarCRM::Response.handle(send!(:get_entry_list, json))
  end
end; end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sugarcrm-0.9.9 lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.8 lib/sugarcrm/connection/api/get_entry_list.rb