sugarcrm icon indicating copy to clipboard operation
sugarcrm copied to clipboard

change of email from invalid to valid

Open ziaulhuda opened this issue 14 years ago • 3 comments

Hi,

I have a contact which have an invalid and a valid email address. When I change a value of an attribute of that contact and call save function, the new value of changed attribute is stored which is good but the problem is the invalid email address is changed automatically to valid email.

Is this a problem of gem or api?

Waiting for response

ziaulhuda avatar Jun 30 '11 09:06 ziaulhuda

Can you give me some code to reproduce this issue?

chicks avatar Jun 30 '11 18:06 chicks

Here is the code. just change the conditions to get some contact who have a invalid email address attached to it

sc_contacts = @sugarcrm::Contact.find(:all, :conditions=>{:date_modified=>">= '#{last_r.gmtime.strftime("%Y-%m-%d %H:%M:%S")}'"})

sc_contacts.each do|contact| contact.contacts_sys_cleverreachid_c = new_id contact.save end

It will change the invalid email to valid email. contacts_sys_cleverreachid_c is a user defined field. You may use any other field for updating

ziaulhuda avatar Jul 13 '11 15:07 ziaulhuda

Whoa... This is a SugarCRM bug. I can confirm this because if you enable debugging on the connection and call save! on the record, you don't see any values passed for the email address.

To reproduce:

  1. Locate a contact record with an invalid or opt-out email address

  2. Load the record a = SugarCRM::User.find(id)

  3. Save the record

    a.save! 4. Opt-out and invalid email will no longer be set.

    set_entry request does not pass any parameters except id:

    set_entry: Request: { "session": "be3da93ff2c9ecef99fb5123cb47a0e3", "module_name": "Contacts", "name_value_list": {"id":{"name":"id","value":"a3d2b5ca-5126-5953-8422-4dc0d2392dcf"}} }

    set_entry: JSON Response: {"id"=>"a3d2b5ca-5126-5953-8422-4dc0d2392dcf"}

chicks avatar Aug 26 '11 19:08 chicks