1

I'm trying to find a best way to setup relationships to the Club that would only "allow" one person to be ex. "Secretary", "Coach" etc. Can this be done via Rules (either CiviRules or Drupal) or database trigger or, hopefully not, a custom module? So basically, when a person gets assign a role, whoever had that role previously has the relationship removed or ended or de-activated.

2 Answers 2

1

I can answer for CiviRules: at the moment there is no such combination of condition and action available in CiviRules.

But there is no stopping you to develop (or have someone develop) such a combination for you. It does not sound too complicated for someone familiar with CiviRules.

Do you have the ability to develop this yourself? The condition would be 'relationship is of the type(s)' (that one already exists) and the action 'de-activate previous relationship' would have to be developed.

There is documentation on CiviRules here: https://docs.civicrm.org/civirules/en/latest/.

Documentation on how to develop your own action is here: https://docs.civicrm.org/civirules/en/latest/create-your-own-action/

1

Pretty sure we have done this via (incorporated in an existing) extension. I don't recall what there was by way of an interface, ie if you could specify relationship type X has a max of 1, but relationship type Y has a max of 3 - or if we just hard-coded for that situation.

It may not take much to refine for public consumption or for your specific use case (ie without a UI)

3
  • Is that extension available to public by any chance?
    – Ralph
    Commented Jan 15, 2019 at 20:43
  • no - sorry if that wasn't clear - when we did it it was part of a custom extension for a client. and per my comment i don't recall if it had a UI or was hard coded in terms of which relationships had what maximum set
    – petednz - fuzion
    Commented Jan 15, 2019 at 20:53
  • Understood. If it's possible I hope I'll find the way myself - I'll learn more of the system on the way :-)
    – Ralph
    Commented Jan 15, 2019 at 20:54

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.