Sha256: d023c1b447424e14261d078fe18670b0a2ea206f513cdb9fbab78d6511080f20

Contents?: true

Size: 989 Bytes

Versions: 9

Compression:

Stored size: 989 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": "#{@sugar_session_id}",
        "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), @session)
  end
end; end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sugarcrm_emp-0.10.1 lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm_emp-0.10.0 lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.18 lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.17 ./lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.16 ./lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.15 ./lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.14 ./lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.13 ./lib/sugarcrm/connection/api/get_entry_list.rb
sugarcrm-0.9.12 ./lib/sugarcrm/connection/api/get_entry_list.rb