rubyzoho
rubyzoho copied to clipboard
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.
This isn't good. Only on Cases?
And only on an empty list?
I've only had this happen on Cases, and only on an empty list.
If RubyZoho is initialized with an empty list, any cases will be messed up.
If it's initialized when there are 1 or more, it works fine. On Sep 18, 2015 10:08 AM, "amalc" [email protected] wrote:
And only on an empty list?
— Reply to this email directly or view it on GitHub https://github.com/amalc/rubyzoho/issues/47#issuecomment-141478495.
That's just plain weird. Because every class except for User is created dynamically based on the initializer and all of the code is shared. I wonder if this happens on any empty list? That would clearly make it a bug. If it's just Cases then it probably in Zoho's API logic. Have you tried an empty list anywhere else?
It could be. I'm unable to test it because this is an Enterprise level account with live data in it that I can't risk.
But, the Cases module behaves differently than most others so I wouldn't be surprised if it's something on their end. On Sep 18, 2015 10:56 AM, "amalc" [email protected] wrote:
That's just plain weird. Because every class except for User is created dynamically based on the initializer and all of the code is shared. I wonder if this happens on any empty list? That would clearly make it a bug. If it's just Cases then it probably in Zoho's API logic. Have you tried an empty list anywhere else?
— Reply to this email directly or view it on GitHub https://github.com/amalc/rubyzoho/issues/47#issuecomment-141491657.
Right. Thanks. I'm not sure how to proceed. Could turn logging on I suppose to see what's happening. Or I guess the work around, which is ugly, is to add a record manually.