Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Trivial
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.5.5, 4.6
-
Fix Version/s: 4.6
-
Component/s: CiviCRM API
-
Labels:None
-
Documentation Required?:None
Description
I wanted to retrieve the most recently added contacts using the API. I did it like this:
$result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'options' => array('sort' => "id DESC"),
));
I got an error message, because id was ambiguous. It seems I could work around the problem this way:
$result = civicrm_api3('Contact', 'get', array(
'sequential' => 1,
'options' => array('sort' => "contact_a.id DESC"),
));
But I think it would be better if an unqualified sort field would be applied to the entity that is retrieved.