2

When you assign a case role through the UI it creates lines in the relationships and activities tables. I can't find an equivalent through the API - I can create the relationship (which then shows correctly in the case UI), but it doesn't create any activity lines. Does that matter? Or is there a better way?

Edit: Running on Civi 4.5.8 on WordPress.

Cheers,

Andrew

1

Looking through the api code for relationships it doesn't appear to be case-aware. You can duplicate what happens in the UI by checking out CRM_Contact_Page_Ajax::relationship(), and note near the bottom where it calls CRM_Case_BAO_Case::createCaseRoleActivity().

Depending on what you mean by "api", that might not be exactly what you're looking for, but you should just be able to add a call to CRM_Case_BAO_Case::createCaseRoleActivity() to the code you've written that already creates the relationship.

  • brill - thank you for digging into the code on that one. – Andrew West Nov 9 '15 at 19:55

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.