2

I'm running into an issue with the api. I use the following call to write to the relationships datatable

$result = civicrm_api3('Relationship', 'create', array(
    'sequential' => 1,
    'contact_id_a' => $contact_a_id,
    'contact_id_b' => $contact_b_id,
    'relationship_type_id' => 11,//your specific relationship id
));

from my solution in https://civicrm.stackexchange.com/a/4619/765

However, when I then go to the relationship tab the new entry is not immediately visible. I usually have to force a refresh by changing the relationships per page from 10 to 25 and then the new entry appears. How can I bypass/avoid this problem?

Thanks, V

1 Answer 1

4

Sounds like you have to 'force' the summary page to rebuild. You can do this by re-building your userContext (which will be the summary page):

$session = CRM_Core_Session::singleton;
CRM_Utils_System::redirect($session->readUserContext());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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