Giter VIP home page Giter VIP logo

rubyzoho's People

Contributors

amalc avatar anithri avatar benknowles avatar kjcpaas avatar qume avatar ryujignh avatar siddhant-mohan avatar swathik avatar tomharvey avatar voodoologic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rubyzoho's Issues

Bad field name errors

I keep receiving an exception for Bad field name on a custom field. Simply trying to list all contacts.

LoadError mime/types

When installing into a new gemset and trying out the Gem:

:001 > require 'ruby_zoho'
LoadError: cannot load such file -- mime/types
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/user/.rvm/gems/ruby-1.9.3-p484@dump/gems/rubyzoho-0.5.0/lib/zoho_api.rb:7:in `<top (required)>'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /home/user/.rvm/gems/ruby-1.9.3-p484@dump/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:1:in `<top (required)>'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from (irb):1
    from /home/user/.rvm/rubies/ruby-1.9.3-p484/bin/irb:12:in `<main>'

This is tested in both 1.9.3 and 2.2.2

The issue can be resolved by gem install mime-types

Cannot update custom fields if Lead initialized with parameters

If we have a custom field on a lead called "Custom Field One" the following code works:

lead = RubyZoho::Crm::Lead.new
lead.custom_field_one = "a new value"

However, the next piece of code will raise a NoMethodError

lead = RubyZoho::Crm::Lead.new(last_name: "Smith")
lead.custom_field_one = "a new value"

I tried to dig into the code to better understand where the custom fields get retrieved but I couldn't really find what I was looking for. With some guidance I'd be happy to write a solution.

undefined method `all' for RubyZoho::Crm::Account:Class

Hey,

Thanks for all the hard work on this gem.

I've been handed the task of integrating parts of Zoho into an existing app that uses Devise. With 0.1.7 I was running into problems with the User class.

So I've bumped to 0.1.8 to solve that, but I'm running into this issue on my first call:

@accounts = RubyZoho::Crm::Account.all

is throwing:

undefined method 'all' for RubyZoho::Crm::Account:Class

I've looked through the codebase, but I'm at a bit of a loss. Perhaps I'm missing something obvious, like a change in the syntax for 0.1.8.

Any help would be much appreciated.

Thanks
Chris

Find by related id doesn't work

RubyZoho::Crm::Contact.find_by_accountid works
RubyZoho::Crm::Deal.find_by_accountid does not work;

NoMethodError: undefined method `index' for nil:NilClass
	from /Users/Alba/.gem/ruby/2.2.2/gems/rubyzoho-0.5.0/lib/zoho_api.rb:232:in `valid_related?'
	from /Users/Alba/.gem/ruby/2.2.2/gems/rubyzoho-0.5.0/lib/zoho_api_finders.rb:35:in `find_record_by_related_id'
	from /Users/Alba/.gem/ruby/2.2.2/gems/rubyzoho-0.5.0/lib/zoho_api_finders.rb:7:in `find_records'
	from /Users/Alba/.gem/ruby/2.2.2/gems/rubyzoho-0.5.0/lib/crm.rb:45:in `run_find_by_method'
	from /Users/Alba/.gem/ruby/2.2.2/gems/rubyzoho-0.5.0/lib/crm.rb:27:in `method_missing'
	from (irb):11

Error starting up

Hi,

Just bundlet your gem, I get the following error. Rails 4.2.0 and ruby 1.9.3 on windows. By the way I use mongoid and no activerecord.

Initializer:

require 'ruby_zoho'

RubyZoho.configure do |config|
  config.api_key = 'my key, not shown here'
  # config.crm_modules = ['Accounts', 'Contacts', 'Leads', 'Potentials'] # Defaults to free edition if not set
  # config.crm_modules = ['Quotes', 'SalesOrders', 'Invoices'] # Depending on what kind of account you've got, adds to free edition modules
  # config.ignore_fields_with_bad_names = true # Ignores field with special characters in the name (Release 1.8)
  # Currently only Quotes are supported
end

Error:

C:\Users\mike\Dropbox\taskhero\taskhero_rails>rails s
=> Booting Thin
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require': C:/Rails/Ruby1.9.3/lib/rub
y/1.9.1/rexml/functions.rb:393: syntax error, unexpected keyword_end, expecting $end (SyntaxError)
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/rexml/xpath.rb:1:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/rexml/element.rb:5:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/rexml/document.rb:1:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubyzoho-0.5.0/lib/zoho_api.rb:4:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:1:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Users/mike/Dropbox/taskhero/taskhero_rails/config/initializers/zoho.rb:1:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:652:in `block in load_config_initializer'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/notifications.rb:166:in `instrument'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:651:in `load_config_initializer'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:616:in `block (2 levels) in <class:Engine>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:615:in `each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/engine.rb:615:in `block in <class:Engine>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:30:in `run'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block in tsort_each'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_strongly_connected_component_from'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:209:in `block in each_strongly_connected_component_from'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:44:in `tsort_each_child'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:203:in `each_strongly_connected_component_from'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block in each_strongly_connected_component'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_strongly_connected_component'
        from C:/Rails/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_each'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/application.rb:352:in `initialize!'
        from C:/Users/mike/Dropbox/taskhero/taskhero_rails/config/environment.rb:5:in `<top (required)>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
        from C:/Users/mike/Dropbox/taskhero/taskhero_rails/config.ru:3:in `block in <main>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
        from C:/Users/mike/Dropbox/taskhero/taskhero_rails/config.ru:in `new'
        from C:/Users/mike/Dropbox/taskhero/taskhero_rails/config.ru:in `<main>'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:61:in `app'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:139:in `log_to_stdout'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/server.rb:78:in `start'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
        from C:/Rails/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Thanks for your help

  • Mike

Not pulling all leads

Is anyone else having an issue getting all leads from Zoho? When I use the RubyZoho::CRM::Lead.all, it seems to be "limited" and does not return all the leads. Any suggestions? Does Zoho somehow limit the response?

Duplicate Check

Is there some way to set the duplicateCheck field? I would like to set it to '2' so that I can update duplicate records on save rather than creating a new record.

Missing fields.snapshot causes Passenger deployment issues

While upgrading my EC2 server to Passenger 4.0.59, Rails 4.2.1 and Ruby 2.1.5, Passenger bombs (and my app never deploys) on a missing file in the rubyzoho gem:

Permission denied @ rb_sysopen - /var/app/current/vendor/bundle/ruby/2.1.0/gems/rubyzoho-0.5.0/lib/../spec/fixtures/fields.snapshot (Errno::EACCES)
  /var/app/current/vendor/bundle/ruby/2.1.0/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:43:in `initialize'
  /var/app/current/vendor/bundle/ruby/2.1.0/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:43:in `open'
  /var/app/current/vendor/bundle/ruby/2.1.0/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:43:in `init_api'
  /var/app/current/vendor/bundle/ruby/2.1.0/gems/rubyzoho-0.5.0/lib/ruby_zoho.rb:29:in `configure'
  /var/app/current/config/initializers/zoho.rb:3:in `<top (required)>'

I could find hide nor hair of the above file in the repository, and don't know what it's for.

I would love to fix the problem, if I were a little better at forking and contributing to gem development. Unfortunately, I am neither of those.

Anyone know what I can do to correct the above?

Authentication?

Hi,

I've been trying out zoho_invoice, however that gem doesn't support v3 of the API. That's why I'm now checking out this gem. I installed it and configured the API key of the application I created on the Zoho site. However I can't find which method I need to call to authenticate a user and get a token?

superclass mismatch for class User (TypeError) (in rails 3)

This happens whenever I include the following in initializers/zoho.rb

require 'ruby_zoho'  

I get the following excpetion in the log upon booting the webserver (unicorn in my case):

More from log:

  • E, [2013-08-28T13:17:03.162368 #21227] ERROR -- : superclass mismatch for class User (TypeError) /Users/luke/rails/il-staging-cedar/app/models/user.rb:1:in `<top (required)>'

The gem looks great can't wait to start using it with Zoho CRM. Thanks for all the good work.

Adding notes to Contacts?

Hi! Great library.

I'm interested in programmatically adding notes to entities like Contacts, Leads, and Accounts. The API docs claim that this is possible, but I haven't been able to figure out how to do this in rubyzoho.

If this functionality doesn't exist, I'm happy to work on a patch if it would be helpful.

How to set Task.related_to Lead.id ?

I have uploaded a new Lead, and now I want to upload a Task with its "related to" field set to that Lead.

I tried task.related_to = lead.leadid, and got a Task record with a blank "related to" in the Zoho website. And when I try task.related_to = 'Lead'; task.relatedtoid = lead.leadid, I get a undefined method relatedtoid=.

So what am I missing? how do I do this simple thing?

NameError in creating a lead

Hi,
While creating a lead i am getting following error

NameError: `@how_did_they_find_about_us_and_what_is_their_need?' is not allowed as an instance variable name

I am running following command on rails console
l = RubyZoho::Crm::Lead.new
l.attr_writers
l.first_name = "test lead"
l.last_name = "last"
l.email = "abcabc.com"
l.save

Triggering workflow from the API

Hi, I have a workflow setup so that when I create a lead a task is created and an email sent. It seems that, although it works if I create a lead on the site, if I do it by API then the lead is created but the workflow isn't triggered.

Judging by this thread
https://forums.zoho.com/topic/send-email-using-zoho-crm-api
It needs to have "wfTrigger=true" set for the xmlData but I have no idea how to do that or if this is even possible with the gem?

Thanks

Can't update custom fields containing 'id'

Hi, I have a custom field named 'Candidate Name' in my Campaign module.

Using the rails console, when I try to update a campaign's 'Candidate Name' field, I don't get any errors -- it appears to succeed.

But, when I check Zoho, the 'Candidate Name' field hasn't been updated.

Looking at the source code, I'm seeing field.rindex('id') used in a few places:
https://github.com/amalc/rubyzoho/search?utf8=%E2%9C%93&q=rindex&type=Code

I think a better solution may be to use field.ends_with?('id'), rather than rindex:

'Candidate Name'.rindex('id')
  => 4

'Candidate Name'.ends_with?('id')
  => false

I haven't looked at the code very carefully (or used Zoho extensively), so I'm not 100% sure this won't cause unintended consequences. If it seems safe, I'd appreciate it if you'd go ahead and make the change. Otherwise, I'm happy to fork the repo, test things out, and put in a pull request.

Tests failing

On a completely fresh clone of master some of the tests fail. Example:

it 'should attach a file to an account' do
    r = RubyZoho::Crm::Account.all.first
    r.attach_file(@sample_pdf, '1_' + File.basename(@sample_pdf)).should eq('200')
end

Fails because r is nil. Creating an Account record in zoho makes this test pass because r is now not nil.

Running the tests with --order default doesn't solve the problem.

Two questions:

Does the Zoho account that the tests are being run against require that records exist already?

Is this an ideal way of doing this? Could the tests be ran in a specific order so that records exist if they are needed?

Unable to add number of employees

I've been trying to make a new lead with the number of employees. It successfully populates other fields, but only the number of employees field isn't populated. Here is my code. Am I missing something?

l = RubyZoho::Crm::Lead.new(:first_name => 'firstname', :last_name => 'lastname', :email => 'email@com', :phone => '123-4567-8910', :company => 'company', :title => 'title', :no_of_employees => 100, :lead_source => 'Web site') 

l.save

<RubyZoho::Crm::Lead:0x007fe4d4424f30 @fields=[:first_name, :last_name, :email, :phone, :company, :title, :no_of_employees, :lead_source], @module_name="Leads", @id="2080032000000118005", @company="company", @first_name="firstname", @last_name="lastname", @email="email@com", @phone="123-4567-8910", @lead_source="Web site", @no_of_employees=100, @created_by="Me", @modified_by="Me", @created_time="2016-09-26 19:23:23", @modified_time="2016-09-26 19:23:23", @title="title">

l = RubyZoho::Crm::Lead.find_by_email('email@com')
l.first.no_of_employees => "0"

Thank you,

How do I use related_records method

RubyZoho.configuration.api.related_records("Contacts", contact_with_attachments, "Attachments") #=> 200

I feel like I should be able to get more from this method.

Smashed my API limit!

I have managed to completely crush my Zoho API limit today. Although I'm not exactly sure how or why.

I only use the gem for getting, and do so in its own class. Like so:

class Zoho
  def self.all_accounts
    Rails.cache.fetch('zoho_accounts') { RubyZoho::Crm::Account.all }
  end
end

I then do stuff using Zoho.all_accounts which presumably looks at the cache and avoids the API call.

The only other place I use it is in some tests:

  before(:each) do
    RubyZoho::Crm::Account.any_instance.stub(:account_name).and_return("ABC Widgets")
    RubyZoho::Crm::Account.any_instance.stub(:accountid).and_return(1)
  end

Will either of these make the excessive API calls that would cause a relatively small app to smash the Zoho limits?

Any advice would be sincerely appreciated.

Thanks!

Data loss when saving Cases when no prior records exist

In order to reproduce this, add "Cases" to the module list and make sure there are no cases records in Zoho.

kase = RubyZoho::Crm::Case.new(
  :status => 'New',
  :type => 'Problem',
  :subject => 'Testing',
  :case_origin => 'Web',
  :priority => 'Medium',
  :description => 'This is a test'
)

kase.save

This will create a record, but none of the field data is saved (all blank). Now if you re-run the script with the existing record it will work fine.

It looks like something isn't being initialized, because you have to reload RubyZoho for it to work, i.e. creating 2 records from scratch doesn't save correctly.

API example fails with Bad field name: city_(pick) error

Running the example from the README:

a = RubyZoho::Crm::Account.all
a.each do |account|
  pp account.account_name
end

...errors out with:

gems/rubyzoho-0.1.7/lib/ruby_zoho.rb:84:in block in create_accessor': Bad field name: city_(pick) (RuntimeError)

RubyZoho: Web service call failed with 400

@amalc: Facing issues while defining the Zoho configurations.

System version

  1. Rails: 4.2.8
  2. Ruby: 2.2.5
  3. Ubuntu: 18.04
  4. rubyzoho: 0.5.0

Currently, my application is running on the above version and when I try to set up the RubyZoho configurations it would not allow me to do so and give me the "Web service call failed with 400" error every time.

NOTE: Same code is working in Ubuntu 16 but not in the newer versions. Locally system + on Heroku-16 stack as well.

I have defined my configuration file like below
Path: config/initializers/zoho.rb

require 'ruby_zoho'

RubyZoho.configure do |config|
  config.api_key = ZOHO_API_KEY
  config.crm_modules = ['Contacts']
end

Basically, I want to deploy my application to the Heroku stack (Heroku-20) but it would not allow me to do so due to this error. If I comment out the configuration file (zoho.rb) then my code is successfully deployed on the Heroku server but along with the Zoho configuration, I can't.

Team can you please help here it would be great to hear from you! Looking forward to your feedback.

zoho_issue

Not getting the product details when making call to Invoice API

I am making request to invoice api
RubyZoho::Crm::Invoice.find_by_id('1496038000000856087')

I am getting all the data related to invoice but not the product_details.

I have checked the data of the direct api call to zoho crm and it's returning me product details also.

updateRecords Date not updating

Hey,

When I try to update a record in a lead that is of type Date using the API it is not saving/updating.

For example

RubyZoho::Crm::Lead.update(id: u.leadid,
fieldname: Time.now.strftime("%m/%d/%Y")
)

The documentation from zoho states

'While updating data, make sure the date and time are in the MM/dd/yyyy and yyyy-MM-dd HH:mm:ss formats respectively'

Regardless of MM/dd/yyyy MM-dd-yyyy dd-mm-yyyy yyyy-mm-dd combinations it does not save, it is not a Time.now format error as I have tried manually typing the string.

However when i try...

https://crm.zoho.com/crm/private/xml/Leads/updateRecords?newFormat=1&authtoken=auth&scope=crmapi&id=id&xmlData=#{dob}

It updates successfully.

Any suggestions as to how to/if it's possible to update date fields using the gem?

Thanks!

Zoho api v2 released.

Just want to confirm, is there any upgrade plan in terms of new zoho api version, v2.

https://www.zoho.com/crm/help/api/deprecation-transition-announcement.html

Deprecation Date: Dec 31, 2018
Issue fixes, API support, and enhancements for the V1 (ie. previous) version will not be taken up beyond the deprecated date. All the V1 API methods will be marked as deprecated.
The V1 APIs used in your existing code will still work even beyond the deprecated date, and will become non-operational only after the Sunset Date mentioned below.

Sunset Date: Dec 31, 2019
All old API methods will not be operational. This means all your codes written based on V1 will stop working.

Proper method for retrieving records modified after

Using version 0.2.0, I was able to pull Account records modified within the past 4 hours.

Since upgrading to 0.5.0, this method no longer works.

Here's how I'm doing it:

    z = ZohoApi::Crm.new(Autobahn::Config.zoho_api_key, ["Accounts"], true, true)
    z.find_records("Accounts", "modified_time", ">", "2015-02-19 11:39:33")

I could find no other way of achieving this with the RubyZoho::Crm::Account.new object, but would love any other method that returns more than the exact match (the > is being ignored).

Apologies if there was a better place to post this. I'm at my wit's end.

API doesn't save custom fields or non string fields

Ok got another one. This one has me stumped.. it seems that if I have a custom attribute or an attribute that isn't text, it will not get saved into zoho if I save those fields using the API.

For instance doing..
irb(main):016:0> my_lead = RubyZoho::Crm::Lead.new(
irb(main):017:1* :first_name => 'Tom',
irb(main):018:1* :last_name => 'Thompson',
irb(main):019:1* :email => '[email protected]',
irb(main):020:1* :phone => '12345',
irb(main):021:1* :no_of_employees => 40,
irb(main):022:1* :pdf_2_requested => "true"
irb(main):023:1> )

irb(main):024:0> my_lead.save

This will create a Lead with the first name, last name, email and phone field all working. But the number field and the custom field are empty.

Can't save fields with _

Hi,

We have created some utm custom fields (utm_campaign, utm_term...) in our zoho but we are not being able to populate them from the API.

We noticed that when the XML to be sent to the API is generated those fields have changed to a capitalized version (Utm Source, Utm Term...) due to the ApiUtils#symbol_to_string method, so although they are sent to Zoho they are not saved (it doesn't trigger any error either).

I was thinking that could be useful creating some kind of "memory" for translations. This way, the string_to_method_name could save that utm_source translates as utm_source, and the symbol_to_string method could recover that translation and send utm_source.

This memory could be created at the RubyZoho::Crm::Lead level.

What do you think?

Thoughts on refactor to allow for other Zoho services

Hi, I'm playing around with allowing the ability to use other services besides CRM. It seems that there are several other products that use the same structure like Sheets, People, Recruit.

My strategy is to turn configure() into an OpenStruct and allow API keys, etc. to be defined for each 'service'.

RubyZoho.configure do |config|
  config.recruit.api_key = "XXXXXXXXXXXXXXX"
  config.recruit.enabled_modules = %w[Candidates Clients JobOpenings Events Interviews]
end

And then any service that is used dynamically sets up that module (RubyZoho::Crm) and its classes.

These are high-level structural changes so I don't see anything breaking, but admittedly writing tests is not my favorite thing to do.

Do you have any suggestions and/or requirements to merge this into master down the road? We could potentially make the config backwards compatible and show a deprecation warning.

Custom field names

Sorry to open yet another ticket about custom field names, I see there have been a few previously but they are marked resolved yet I am still experiencing issues.

I have a field named 'Price ex GST' which I can't set the value of (x.price_ex_gst = "123"). When I change the field name to 'Price Ex Gst' it works fine. I need it to work with the current field name in production otherwise it will break legacy code.

I see in the previous issues there was mention of mapping the field names correctly to account for differences in capitalisation but that doesnt seem to be working for me. I'm using 0.5.0 straight from RubyGems

Is there some way I can fix this? I am happy to hard code the field name mapping in the initialiser if required.

Can't save to custom fields.

Hi again,

I'm having trouble updating custom fields from Ruby. My Contacts module has a Zendesk ID field that I'm able to access from the API. But I haven't successfully been able to write to it. I've checked the field permissions, and it is visible and read-write to all users. Here's a test case:

require 'bundler'
Bundler.require(:default)

RubyZoho.configure do |config|
  config.api_key = ENV['ZOHO_API_KEY']
  config.crm_modules = ['Contacts']
end

c1 = RubyZoho::Crm::Contact.new
c1.last_name = 'smith' #required
c1.email = '[email protected]'
c1.zendesk_id = 'abc123'
c1.save
c1.zendesk_id
#=> abc123

c2 = RubyZoho::Crm::Contact.find_by_email('[email protected]').first
c2.zendesk_id
# => nil

Any ideas?

I've also noticed some issues where the zendesk_api method doesn't get created on Contact instances unless I call RubyZoho::Crm::Contact.new first. Not sure if they're related, but I can work up a test case for that too.

Adding/receiving products in SalesOrders

Hi I could not add products to a SalesOrders nor Quotes, and when I try to get a SalesOrder/Quote i get the product_details nil.

is there anything I do wrong?

my config looks like this
RubyZoho.configure do |config|
config.api_key = Rails.configuration.zoho_auth_token

config.crm_modules = ['Contacts', 'Leads', 'Activities'] # Defaults to free edition if not set

config.crm_modules = ['Products', 'SalesOrders', 'Vendors', 'Quotes'] # Depending on what kind of account you've got, adds to free edition modules

config.ignore_fields_with_bad_names = true # Ignores field with special characters in the name (Release 1.8)

Currently only Quotes are supported

config.cache_fields = true
end

best,
octavian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.