Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sugarcrm_v10

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sugarcrm_v10

  • 0.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

SugarCRM REST v10 Summary: An effective tool to interact with SugarCRM through the REST v10 api Features: • Supports creating, updating, retrieving records from modules in SugarCRM • Lists records filtered by an expression • Access to related modules • Supports uploading and downloading documents via document module • Access API methods directly on the SugarCRM.connection object

Synopsis: Establishing a connection: SugarCRM::Connection.connect(,<consumer_key>,<consumer_secret>,,,) SugarCRM::Connection.connect(https://instance.sugarcrm.com,”testkey”,”sugar”,”admin”,”xxxx”,”sugarplatform”)

Create a new record to a module: SugarCRM::Connection.create_record(,) SugarCRM::Connection.create_record(“Contacts”,{ :first_name => “Shanker”, :last_name => “Raj”, })

Retrieve all records from a module: SugarCRM::Connection.fetch_all(,<max_num>,) #retrieves first 20 records SugarCRM::Connection.fetch_all(“Accounts”) #retrieves 10 records with offset 5 SugarCRM::Connection.fetch_all(“Accounts”,10,5)

Retrieve records by fields: SugarCRM::Connection.fetch_any_fields(,<max_num>,) #retrieves name and email addresses of 30 records with offset 2 SugarCRM::Connection.fetch_any_fields(“Contacts”,30,2,[”name”,”email_address”])

Retrieve a single record from a module: SugarCRM::Connection.fetch_single_record(,) #retrieves record with id 3
SugarCRM::Connection.fetch_single_record(“Accounts”,3) #retrieves only first_name of the record SugarCRM::Connection.fetch_single_record(“Accounts”,3).first_name

Update a record of a module: SugarCRM::Connection.update_record(,,) #updates billing address of a user SugarCRM::Connection.update_record(“Users”,2,{ :billing_address => “abc” })

Retrieve records by conditions: SugarCRM::Connection.filter_records(,<max_num>,,,)

#retrieves first 30 records with first_name ‘Ann’ SugarCRM::Connection.filter_records(“Contacts”, 30,0, { :first_name =>"Ann" }) #retrieves all ‘address’ and ‘phone’ whose first_name starts with‘A’ SugarCRM::Connection.filter_records(“Contacts”,nil,nil, [”phone”,”address”],{ :first_name =>{"$starts”=> ”Ann" }})

Filter records with and/or sub-expression types : SugarCRM::Connection.filter_by_and_or(,<max_num>,,,) #retrieves first 4 records whose last name is Hona and primary address state is CA SugarCRM::Connection.filter_by_and_or("Accounts",4,0,[ “name”,”title” ],{ "$and"=>{"last_name"=>"Hona", "primary_address_state"=>"CA" }})

#Add a meeting to a contact : SugarCRM::Connection.create_related(,,,<link_name>) SugarCRM::Connection.create_related("Contacts",3,{ "name"=>"Test Meeting4", "description"=>"SugarMeeting4", "duration_hours"=>2 },"meetings")

Retrieve related module fields : SugarCRM::Connection.fetch_related(,,,<link_name>) #retrieves all document id related to a contact SugarCRM::Connection.fetch_related("Contacts",9,”id”,"documents")

Download a document via document module : SugarCRM::Connection. download_document(<document_id>,<path_to_save>) SugarCRM::Connection. download_document(“2”,’E:/’)

Upload a file : SugarCRM::Connection. upload_document() SugarCRM::Connection. upload_document ("name" => 'E:\ filename.pdf',
"status_id" => "Active", "doc_type" => "Forms", "category_id" => "Application", "document_name" => "filename.pdf", "template_type" => "Forms", "revision" => 1, "active_date" => Date.today, "subcategory_id" => "Other", ) Using gem in Console :

  1. Type ‘irb’ in command prompt
  2. Use ‘require sugarcrm’ to require the gem
  3. Connect to SugarCRM instance by calling SugarCRM::Connection.connect providing the arguments(refer the documentation above)
  4. Now you can access all the above API methods directly on the SugarCRM.connection object Sugarcrm gem with Concurrent Sessions : The SugarCRM gem works with more than one session concurrently. Call SugarCRM::Connection.connect on each and access the methods on its object as shown below: Sugarcrm_conn1 = SugarCRM::Connection.connect(url1,..) Sugarcrm_conn1.fetch_all(“Accounts”) Sugarcrm_conn2 = SugarCRM::Connection.connect(url2,..) Sugarcrm_conn1.fetch_all(“Accounts”)

Install : $ gem install sugarcrm_v10

FAQs

Package last updated on 18 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc