Answers.Body: <p>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.</p>
  
  <p>It may not take much to refine for public consumption or for your specific use case (ie without a UI)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T20:43:19.000Z
Answers.Text: Is that extension available to public by any chance?
Answers.UserDisplayName: Ralph
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T20:53:02.803Z
Answers.Text: 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
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T20:54:59.087Z
Answers.Text: Understood. If it's possible I hope I'll find the way myself - I'll learn more of the system on the way :-)
Answers.UserDisplayName: Ralph
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T20:31:10.410Z
Answers.LastActivityDate: 2019-01-15T20:31:10.410Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>I can answer for CiviRules: at the moment there is no such combination of condition and action available in CiviRules. </p>
  
  <p><strong>But</strong> 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. </p>
  
  <p>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.</p>
  
  <p>There is documentation on CiviRules here: <a href="https://docs.civicrm.org/civirules/en/latest/" rel="nofollow noreferrer">https://docs.civicrm.org/civirules/en/latest/</a>. </p>
  
  <p>Documentation on how to develop your own action is here: <a href="https://docs.civicrm.org/civirules/en/latest/create-your-own-action/" rel="nofollow noreferrer">https://docs.civicrm.org/civirules/en/latest/create-your-own-action/</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-01-15T12:49:27.420Z
Answers.LastActivityDate: 2019-01-15T12:49:27.420Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>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.</p>
  
Tags: <relationships>
Title: Exclusive Relationship to organisation
ThreadText: # Exclusive Relationship to organisation
  
  (Asked by: username_0 on 2019-01-15)
  
  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.
  
  **Tags:** relationships
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-01-15. Score: 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)
  
  > **Comments:**
  > **username_0**: Is that extension available to public by any chance?  
  > **username_1**: 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  
  > **username_0**: Understood. If it's possible I hope I'll find the way myself - I'll learn more of the system on the way :-)  
  
  ---
  
  ### Answer by username_2 on 2019-01-15. Score: 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/>
  
  
  ---
  
  