I've also been searching for an easy way to do this. I can't seem to find one, but there is something of a workaround using other functions. Where I used to call the API as follows:
Code:
$result=$this->soap->get_entry list(
$session, // session id
'Contacts', // module name
" contacts.email1='".$email."', // query
' contacts.last_name', // order by
0, // offset
array(), // array of fields to be retrieved
1, // max number of entries to retrieve
false // whether to show deleted entries
); Clearly this will no longer work, since 'email1' is no longer a field in the contacts database. The way around this is to use the contact_by_email function in the api to grab the id for the contact:
Code:
$contact = $this->soap->contact_by_email(SUGAR_USER, SUGAR_PASS, $email);
Then we can use this id to retrieve the rest of the contact information:
Code:
$result=$this->soap->get_entry list(
$session, // session id
'Contacts', // module name
" contacts.id='".$contact[0]['id']."', // query
' contacts.last_name', // order by
0, // offset
array(), // array of fields to be retrieved
1, // max number of entries to retrieve
false // whether to show deleted entries
); This seems to be pretty foolproof since the user ID's are unique values, and looking up a contact by his or her ID is the most certain way to find that contact. The only thing this does NOT check for is more than one contact with the same email, but if that happens, you have duplicate record problems anyway.
Hope this helps. It's the only workaround I know for the time being, and I'm by no means an expert with SOAP or Sugar.
-jae
Bookmarks