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

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
Parents
  • Hi, in data/SugarBean.php is the function retrieve_by_string_fields

    /**     * Constructs a select query and fetch 1 row using this query, and then process the row
         *
         * Internal function, do not override.
         * @param array @fields_array  array of name value pairs used to construct query.
         * @param boolean $encode Optional, default true, encode fetched data.
         * @param boolean $deleted Optional, default true, if set to false deleted filter will not be added.
         * @return object Instance of this bean with fetched data.
         */
        function retrieve_by_string_fields($fields_array, $encode=true, $deleted=true)


    It seems only retrieve fields from own and 'cstm' table, for this reason "email1" is empty.



    Regards,
    Esteban
Reply
  • Hi, in data/SugarBean.php is the function retrieve_by_string_fields

    /**     * Constructs a select query and fetch 1 row using this query, and then process the row
         *
         * Internal function, do not override.
         * @param array @fields_array  array of name value pairs used to construct query.
         * @param boolean $encode Optional, default true, encode fetched data.
         * @param boolean $deleted Optional, default true, if set to false deleted filter will not be added.
         * @return object Instance of this bean with fetched data.
         */
        function retrieve_by_string_fields($fields_array, $encode=true, $deleted=true)


    It seems only retrieve fields from own and 'cstm' table, for this reason "email1" is empty.



    Regards,
    Esteban
Children
No Data