2

Scenario:

A case has a Purchasing Partner role. Sometimes that needs to be changed and we want to do so via a webform (from a View with links containing whatever cid1 etc it needs).

My testing shows that if I try with just the cid1 (who is case client) and cid2 (who is existing PP) in the url and add a third cid for the new partner, when we submit the form we hope it will

  • terminate the Relationship between cid1 and cid2 (which seems to be how I can do this on a contacts record directly in civi itself and the only way i can approach this on the webform since there is no option to eg specify 'remove existing case role') and
  • create a Case Role for cid 3

the outcome is that

  • the original relationship between cid1 and cid2 remains untouched, and a new disabled (due to End Date) relationship is created between cid1 and 2
  • a new case role and relationship is created for cid 3

Should we be able to do this as webform code stands? Does adding the caseid=x help (i did test that but saw no difference)

  • Pete, I have tried every possible combination and cannot get this to work either. Unfortunately for now I have folks going into the back end to change case roles but that is not the preferred implementation in our case. Wish I had an answer for you. – Paul Mosey Oct 28 '16 at 15:15
  • I wonder if it could be tied to the A-B relationship. When I create add a case role in Civi, it calls the relationship case manager. When I use webform to assign a case role by using the case tab on the webform it creates the relationship case manager is not case manager. – Paul Mosey Oct 28 '16 at 15:19
  • This continues to be a big issue for me on multiple installs. Has anyone found a work-around? – Paul Mosey Feb 15 '17 at 11:04
  • You might need to get an estimate from Coleman, maybe via drupal.org – petednz - fuzion Feb 15 '17 at 19:20
0

I just did a simple test and it appears to be working ok. This is what I did (using the latest version of CiviCRM and Webform-CiviCRM):

  • Create a simple webform with 2 contacts
  • Contact 2 - relationship to contact 1 (sibling) - relationship is active: "User Select"
  • Contact 2 "existing contact" field - autocomplete.
  • Submit the form with relationship is active: yes
  • Observe the active relationship in CiviCRM
  • Submit the form with the same 2 contacts, relationship is active: no
  • Observe the same relationship in CiviCRM is no longer active. No duplicate relationship created.
  • The OP related specifically to Case but this answer doesn't mention it in the steps above. So it may be a good answer, just unclear at this point. Will have a look next week – petednz - fuzion Feb 17 '18 at 22:06
  • Tested the above with a case via creating a webform with 3 contacts (all existing) and a case. Case client set to contact 1 and a 'test case role' set to be user select. Contact 2 autocompletes from relationship to Contact 1 and has 'Relationship is Active: User Select'. Submit form with Relationship is Active: NO, a contact for Contact 3 and 'Test Case Role = Contact 3". This disabled the 'Test Case Role' relationship between 1 and 2 and created a new 'Test Case Role' relationship between 1 and 3 – petednz - fuzion Mar 7 '18 at 5:04
2

This is not currently possible so I have opened issue here.

  • Sorry. Thought I was in the comment area. – Paul Mosey Feb 18 '17 at 21:12
  • nw. i just edited this so it would look more like an answer ;-) – petednz - fuzion Feb 18 '17 at 21:18
0

If I understand the issue correctly, it sounds like there's a bug where webform attempts to disable a relationship but instead creates a new disabled relationship. This may be due to recent upstream changes in the Civi api - iirc the v3 relationship api is a little odd.

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.