2

I don't make use of the end date in relationships. I only ever explicitly create relationships. And yet I'm aware that there are a significant number of Inactive Relationships in my system. How do these relationships become inactive? It's not a result of manual intervention, so it must be happening programmatically as a result of some other action that is being taken.

I'd love to know what's going on.

8
  • 2
    Are you using civicase? Roles end when the case closes.
    – Demerit
    Feb 13, 2019 at 20:31
  • Thanks, but no. Not using Civicase. I think it might be something to do with merging records, but that's just a guess.
    – Graham
    Feb 14, 2019 at 9:11
  • are you using webforms. we just had a case of 'how did that get disabled' - turned out the webform setting had been set to 'disable'
    – petednz - fuzion
    Feb 14, 2019 at 20:06
  • I am using webforms, and I'll check them, but as far as I'm aware they are only ever creating relationships.
    – Graham
    Feb 15, 2019 at 10:27
  • Here's a thought: If someone submits a webform and says their current employer is X, then some months later submits a different form and says their current employer is Y, does Civi disable the relationship with X? i.e. does it assume that individuals only ever have one current employer?
    – Graham
    Feb 15, 2019 at 13:36

3 Answers 3

2

I do know there is a cron job (Disable expired relationships (Daily)) that inactivates relationships when the end date is in the past. That might be active in your environment, but you state that there are no end dates? Did you not have any in the past either? And is this scheduled job active on your installation?

Another cause might be the employer/employee relationship when you remove the employer from the contact summary?

2
  • Wot Erik said. Just had a play in the sandbox. Add current employer. Save, then delete employer (all with inline editting) dmaster.demo.civicrm.org/civicrm/contact/… Employer Relationship shows as inactive Feb 14, 2019 at 18:01
  • The cron job is active and expired relationships are being disabled. However I'm not setting end dates for relationships, so unless they are being set by some other means that I'm not aware of, this shouldn't be an issue. I'll turn off the job anyway just to see.
    – Graham
    Feb 15, 2019 at 10:26
2

The default action is that the latest employer becomes the active and current employer and the former employer becomes inactive. This occurs because this is what typically people want to happen. As a user registering for an event in 2017, I put my employer as Alphabet, but in 2019, I register for an event, and put my employer is Microsoft, CiviCRM assumes that I changed employers and no longer work for Alphabet.

Unfortunately there isn't a way to my knowledge to stop this from happening or to limit its scope. But it is easy to reactivate any inactive relationships - just becomes an extra step.

3
  • That's a pretty big assumption for CiviCRM to make. Increasingly people wear multiple hats in different contexts and work with/for multiple organisations. I might well work for Microsoft, and be attending an event on behalf of a different organisation - maybe a non-profit that I'm working for part-time. Surely there should be a way to allow multiple relationships to persist rather than disabling them on what is pretty thin evidence.
    – Graham
    Feb 20, 2019 at 10:10
  • So in your case, how would you know when a relationship is inactive. Or rather, how would you like it to be handled?
    – themak
    Feb 20, 2019 at 15:27
  • I don't know when relationships are being inactivated, which is a problem. Getting a notification would be good. How would I like it to be handled? I would like the administrator to be in control of the relationships so that they can choose when they get inactivated.
    – Graham
    Feb 25, 2019 at 14:16
2

CiviCRM also does "employer relationship magic" if a postal address is shared with another contact. If you share an address with it will create an employer relationship and disable any existing one.

IMHO this does not make sense but unfortunately it is kind of deeply integrated with the core code. We had to disable/adapt this function for a customer - anyone interested can have a look here.

1
  • Again, this is a neat trick if it makes sense in the given context. If it doesn't then it's potentially a massive PITA.
    – Graham
    Feb 20, 2019 at 10:11

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.