amalc / rubyzoho

Abstracting Zoho’s API into a set of Ruby classes, with reflection of Zoho’s fields using a more familiar ActiveRecord lifecycle, but without ActiveRecord. Works with Rails and Devise.
MIT License
62 stars 57 forks source link

updateRecords Date not updating #25

Open craigk1 opened 10 years ago

craigk1 commented 10 years ago

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!

amalc commented 10 years ago

That's interesting. Let me take a look. It should just be a straight pass-through as a string.

mark-kraemer commented 9 years ago

I just ran into this issue trying to update a Date field named "Student DOB" in Zoho. Looking at the XML produced, I realized the value was set to "Student Dob". It seems that rubyzoho doesn't take into account all capital words. Changing my field name in zoho to "Student Dob" allowed me to save the date.

What rubyzoho produced: <Leads><row no='1'><FL val='Student Dob'>06/09/1995</FL></row></Leads>

What Zoho expected: <Leads><row no='1'><FL val='Student DOB'>06/09/1995</FL></row></Leads>

amalc commented 9 years ago

Yes. That right. There's a fix underway in master but I haven't had to me to test it.


Amal Chaudhuri * +1-212-537-9054

On June 9, 2015 3:11:37 PM EDT, Mark Kraemer notifications@github.com wrote:

I just ran into this issue trying to update a Date field named "Student DOB" in Zoho. Looking at the XML produced, I realized the value was set to "Student Dob". It seems that rubyzoho doesn't take into account all capital words. Changing my field name in zoho to "Student Dob" allowed me to save the date.

What was produced: <Leads><row no='1'><FL val='Student Dob'>06/09/1995</FL></row></Leads>

What Zoho expected: <Leads><row no='1'><FL val='Student DOB'>06/09/1995</FL></row></Leads>


Reply to this email directly or view it on GitHub: https://github.com/amalc/rubyzoho/issues/25#issuecomment-110467610