I'm trying to get Activity information via the API, but have run into two issues:
I cannot seem to filter by a date stored in a custom field. I've tried formatting the date multiple ways ('Y-m-d', 'm-d-Y', 'YmdHis', etc), but it doesn't seem to have any impact.
Since I can't figure out to make the filter work, I thought I would do the filtering myself. But I can't seem to get the custom field to be returned in the results. When I try in the API Explorer, I get all kinds of data back for each activity. But when I copy / paste the PHP code, I only get a small amount of activity fields, and definitely not the custom field I need.
This is the code from the explorer that isn't working for me when I actually use it in code:
$result = civicrm_api3('Activity', 'get', array( 'return' => "custom_46", 'status_id' => "Scheduled", 'activity_type_id' => "TDY", ));
The Explorer shows all activity data for each result. When running the generated PHP code in my code, I only get the Activity ID, Activity Type ID, Status ID, and Source Contact ID.