1

The default field on the Activity API doesn't return 'result' field by default, or even when specified as a return value. I've never added one of these before, if someone could let me know how it's done I'll sort a PR out. Thanks!

If anyone's interested - the use case is deleting Twilio's copy of messages after a period on a scheduled job. The return value is Twilio's SMS Unique ID.

  • I think there is some weird logic that blocks it somewhere in the code for reasons unclear – user4278 Jul 21 '18 at 0:20
2

Api result doesn't return if the fields value is NULL. In your case result field must be NULL for the activity you trying to get. Try using to check if the result key is present in api result and use accordingly.

$result = CRM_Utils_Array::value('result', $activityResults); or !empty($activityResults['result'])

enter image description here

HTH

Pradeep

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.