AnsweredAssumed Answered

Why is the email1 field empty when retrieving a user using retrieve_by_string_fields()?

Question asked by Asaf Army on Dec 5, 2014
Latest reply on Dec 7, 2014 by Asaf Army
Why does $user->retrieve_by_string_fields() is finding the user but with an empty email1 field?

i need to retrieve a user and then update it using save().
i noticed that each time i do that, the email1 is deleted.
so i checked the user email1 field and noticed that after i retrieve it, it is always empty! (although the user has an email of course).

i use this code to retrieve the user:
$user = new User();
$user->retrieve_by_string_fields(array('gc_notif_channel_id_c' => $channelID));

and i find the user alright and all the other fields values are ok, except the email1 field is empty!
later i call $user->save(); and the user email1 is deleted because on the retrieve, it was with email1 field as empty.

does anyone know what the problem is?
how could i ever update a user details if the user email1 field is not retrieved ok?

using community rdition 6.5.13