Sha256: 92a6e384e6b9d12d0175f67fff9a696b5e233a094527b219dd9e0c7913610d96

Contents?: true

Size: 642 Bytes

Versions: 4

Compression:

Stored size: 642 Bytes

Contents

module SugarCRM; class Connection
  # Retrieves a single SugarBean based on the ID.
  def get_entry(module_name, id, opts={})
    login! unless logged_in?
    options = { :fields => [], 
      :link_fields => [], 
    }.merge! opts
    
    json = <<-EOF
      {
        \"session\": \"#{@session}\"\,
        \"module_name\": \"#{module_name}\"\,
        \"id\": \"#{id}\"\,
        \"select_fields\": #{resolve_fields(module_name, options[:fields])}\,
        \"link_name_to_fields_array\": #{options[:link_fields]}\,
      }
    EOF
        
    json.gsub!(/^\s{6}/,'')
    SugarCRM::Response.handle(send!(:get_entry, json))
  end
end; end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sugarcrm-0.7.9 lib/sugarcrm/connection/api/get_entry.rb
sugarcrm-0.7.8 lib/sugarcrm/connection/api/get_entry.rb
sugarcrm-0.7.7 lib/sugarcrm/connection/api/get_entry.rb
sugarcrm-0.7.2 lib/sugarcrm/connection/api/get_entry.rb