1

I'm trying to create a View of people with relationships to an organisation with options to disable those relationships. I have created the view and added a VBO field on the relationship.

In the Selected Bulk Operations section, I have selected Modify Entity Value and then in the display section selected Relationship is Active. enter image description here

The view then shows a 'Modify entity values' and after clicking that button I get a text box to enter the value of Relationship is Active. Entering '0' and submitting then has the intended effect of disabling the relationship in Civi.

But ... what I really want is the button to say "Disable relationship(s)" and when clicked to set the Relationship is Active to 0 without asking the user for a value.

How can I achieve that? (Drupal 7, CiviCRM 4.6.18, civicrm_entity 7.x-2.0-beta1)

2

First part is easy. When you check the box 'modify entity values' in the VBO field, you should see an option to tick another box that says 'override label'. That lets you then set the button that users will see to be 'Disable relationships'.

The second bit - i think it would require more code for CiviCRM Entities module or civicrm_entity_actions. I say this because on a VBO i set up recently I had the option to tick both 'Add to Group' and 'Remove from Group' (and there was also 'modify entity values') - so it sounds like you need the options for 'Enable Relationship' and 'Disable Relationship' to be explicit options at that step.

  • Thanks - I don't see any options for 'Add to Group' or 'Remove from Group' but they sound like a good start for creating something for the relationships. Did you have something custom to provide those? – Aidan Jun 9 '16 at 20:44
  • Nothing custom - using CiviCRM Entity module but assume you are too. I think the options you see will depend on the base table for the View. In my case this is CiviCRM Contact - assuming in yours it is CiviCRM Relationship. yes? – petednz - fuzion Jun 9 '16 at 21:14
  • Yes, I'm using CiviCRM Entity. Mine is also using Contacts as the base. I've tried using different base tables but the options are all the same so far. Which version of CiviCRM Entity are you using? I've tried 7.x-2.0-beta1 and 7.x-2.x head from github. – Aidan Jun 9 '16 at 21:53
  • 1
    oh. sorry. am also using civicrm_entity_actions from github.com/eileenmcnaughton/civicrm_entity_actions – petednz - fuzion Jun 9 '16 at 22:26
  • Many thanks Pete - that's the missing bit. I've hacked in a 'Disable relationship' which is working nicely. I'll PR it when I'm done. – Aidan Jun 10 '16 at 13:06

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.