1

Suppose I am using relationships for specific classes where the student in a class (organization) may not have a start and end date. Is there a way for me to look up a particular class and globally update all the students/relationships by adding an end date when that class ends?

I am talking about the relationship between a company (class) and an individual (student) in the join table, not the current "employer" field on the individual record.

Ideally, i would like to globally import end dates but can't do that without the relationship key. Is there a way to create a profile listing all current relationships of an organization where I can manually set end dates for students in a editable spreadsheet/profile format? I have many students assigned to classes that have ended and want to globally end those relationships without having to go to mySQL.

In other words, I need to create a listing of all the "active" relationships of an organization so I can easily edit start and end dates without a pop-up form.

2 Answers 2

2

I'm guessing you already looked at Batch Update Relationships although it seems like maybe the extension technique isn't working anymore.

The below is maybe only a step above running some SQL directly and I don't recommend it for the average office staffer but it seems to work and is mostly straightforward. The danger is if you get the criteria wrong you might update way more relationship records than you thought.

  1. Visit [your_site_url]/civicrm/api4
  2. Make it look like this screenshot, where you pick the appropriate org contact and set the end date at the bottom to the appropriate date.
  3. api screenshot
  4. Optionally add a "where" criteria for a specific relationship type or types.
  5. Click Execute.
  6. At the bottom right you should see a list of the updated ones.
1
  • I love the import plugin you suggested (API CSV Import GUI extension). Thank you.
    – Stacey
    Jul 12, 2019 at 22:40
1

With SearchKit, probably from version 5.43, it will be possible to do in-place edits of relationship fields as start and end dates, is active and custom fields. https://github.com/civicrm/civicrm-core/pull/21533

Your Answer

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

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