I am trying to get data out of the API and when I look at it in API explorer I find what I am looking for but the data is incomplete in my module.
For example, I am using civicrm_post($op, $objectName, $objectId, &$objectRef) and I know this is working because I have if ($objectName != "Case" || $op != "create") and my code in the if is firing.
civicrm_initialize();
$result = civicrm_api3('Case', 'get', array(
'sequential' => 1,
'id' => $objectId,
));
Here is the result from the API call in my module:
Array
( [is_error] => 0 [version] => 3 [count] => 1 [id] => 352 [values] => Array ( [0] => Array ( [id] => 352 [case_type_id] => 5 [subject] => Test Case Subject [start_date] => 2017-07-24 [status_id] => 4 [is_deleted] => 0 [contact_id] => Array ( )
[client_id] => Array
(
)
[contacts] => Array
(
)
[activities] => Array
(
)
)
)
)
Here is the result from the API Explorer:
{
"is_error": 0,
"version": 3,
"count": 1,
"id": 352,
"values": [
{
"id": "352",
"case_type_id": "5",
"subject": "Test Case Subject",
"start_date": "2017-07-24",
"status_id": "4",
"is_deleted": "0",
"custom_70": "IL",
"custom_72": "Peoria County",
"custom_76": "1",
"custom_78": "2",
"custom_92": "Farmers",
"custom_100": "1500943386-26151211",
"custom_95": "Test",
"custom_96": [
"1"
],
"custom_97": [
"1"
],
"custom_98": [
"1"
],
"custom_99": [
"1"
],
"contact_id": {
"1": "9025"
},
"client_id": {
"1": "9025"
},
"contacts": [
{
"contact_id": "9025",
"sort_name": "Applications , Test",
"display_name": "Test Applications",
"email": "[email protected]",
"phone": "",
"birth_date": "1919-04-04",
"role": "Client"
}
],
"activities": [
"21781",
"21782"
]
}
]
}
Any help is appreciated.
Thanks, Josh
$result
when your code runs? (maybe edit your question to include the two different results?)