CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Using Webform to delete a Relationship ?
Pages: [1] 2

Author Topic: Using Webform to delete a Relationship ?  (Read 1695 times)

JMM

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Using Webform to delete a Relationship ?
November 11, 2014, 07:28:43 am
I have created a Webform so that an Organization Admin can create Relationships with Individuals with several optional roles, without having any CiviCRM Permission.

Can I create a Webform so that he could delete a Relationship (e.g. fix an error) ? How ?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Webform to delete a Relationship ?
November 11, 2014, 07:44:00 am
You're talking about the drupal Webform-CiviCRM Integration module right?
It does not currently support deleting relationships, sorry. Probably the best you can do is to create a webform that allows the user to request that a relationship be deleted and then have your staff manually review these requests. IMO this is a safer way to go anyway because of the potential loss of data.
Try asking your question on the new CiviCRM help site.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Webform to delete a Relationship ?
November 11, 2014, 10:31:28 am
What Coleman said - or maybe add a field to relationships for 'requires deleting' -  adding this on the webform - also let them set the Relationship to expired - then admin can do it as a 'once a week' task - rather than getting an Activity alert for each (which was how I thought Coleman might be implementing it)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

JMM

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: Using Webform to delete a Relationship ?
November 13, 2014, 10:43:42 am
Thank you both for your suggestions,

My problem is that I am the only staff, and will have to manage a lot of more or less complex Organizations (with a lot of Org. Admins)

As an alternative, I also consider to give them just some Permissions (?) to enable them to manage it (but I don't like).

I remain open to all suggestions.

Thank you again

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Webform to delete a Relationship ?
November 13, 2014, 10:59:33 am
JMM - how poor a substitute is letting them set an 'end date' to expire the relationship - and perhaps give them another field on the Relationship so they can check 'was an error', for example
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Webform to delete a Relationship ?
November 13, 2014, 11:04:09 am
Ooh, nice idea Pete. End date can be exposed to Webforms, and would have basically the same effect as deleting the relationship (but would still retain the history in the db).
And here's a clever UI tweak: once you expose the "end date" field to the webform, switch its widget from "date" to "select" - then set it up as "checkboxes" with only one option. Give that option the label "Cancel this Relationship" and the value "now". So you'd end up with a checkbox on the form that says "Cancel this relationship" and sends the param to the api end_date => 'now'. (I'm so clever).
Try asking your question on the new CiviCRM help site.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Webform to delete a Relationship ?
November 13, 2014, 11:08:04 am
hmm - nice  ;D
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Webform to delete a Relationship ?
November 13, 2014, 11:08:45 am
JMM Would be good to see questions like this asked at drupal.stackexchange.com and help us all get more questions managed in a better way. If you don't already have one, would you set yourself up an account, ask the question over there, paste link back here, oh and of course 'commit' to area51.stackexchange.com/proposals/77367/civicrm

(forum regulars - pls consider replicating this message on lots of threads to help lift our StackExchange proposal in to Beta - just copy the above and paste on other threads until someone starts complaining)
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

JMM

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: Using Webform to delete a Relationship ?
November 14, 2014, 08:07:56 am
Very clever indeed ! I will test that (and come back soon)

Concerning stackexchange (I just heard of), what is the interest, compared to this forum ?

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Using Webform to delete a Relationship ?
November 14, 2014, 11:20:51 am
We are trying to push a core part of forum Q and A over there as it helps identify regular questions and rate them and the answers etc
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Webform to delete a Relationship ?
November 25, 2014, 05:35:10 am
JMM How did it work?
Try asking your question on the new CiviCRM help site.

JMM

  • I post occasionally
  • **
  • Posts: 67
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: Drupal 7.34
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: Using Webform to delete a Relationship ?
November 25, 2014, 08:38:16 am
Finally, I did not test it : I am still hesitating between different ways :
- Relationships vs Memberships (CiviMember)
- Admin permissions (using the standard UI) vs restricted (Webform)

I have just explored CiviMember, and my current feeling is that CiviMember provides your proposed solution (or very similar) as standard (?) + other features which can be useful to some of our Organizations (e.g. : Membership Fee).

So ...

(I apologize for being so slow, but though I am retired, I am not full time on this project (I also play golf  ;) ) + I really spend a lot of time testing different solutions to meet my specification requirements : CiviCRM is a big software, and we are not numerous in France to use it)

So, thanks a lot for your help

DWGray

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.6 (in development)
  • CMS version: Drupal 7
  • MySQL version: unknown
  • PHP version: unknown
Re: Using Webform to delete a Relationship ?
January 02, 2015, 10:57:05 am
Evening,

I am currently looking at something for our website which would be a natural-ish progression from where JMM was heading.

We have member organisations with a local admin who manages their records. We would prefer to use webforms to allow them to update their "Main Contact" which for legal reasons we are required to have a single named individual in this role. What I was thinking of trying is expiring a relationship with a time of 'now' and starting a relationship with a time of 'now' on the same form.

My logic and understanding of Civi says that I would set the webform up viz:

Contact 1: Individual (the admin)
Existing Contact checked - so that they would need to be permissioned to make the changes

Contact 2: Organisation
Existing Contact checked  - so that we prevent spurious new organisations being created
Relationships enabled and specifies that contact 1 can view and edit the organisation

Contact 3: Individual (existing main contact)
Existing Contact checked
First Name and Last Name visible but disabled so it can not be edited (as the contact would remain)
Relationship end date set to now as per Coleman Watts' thoughts

Contact 4: Individual (new main contact)
They would already be associated with the organisation through a custom volunteer of relationship (we can call it as same principle) so we want the admin to be able to see al those that are volunteers at the organisation
Relationship set for main contact of and a start state set to now using the same steps as Coleman's thoughts again

Would that work?
My thought process is that unless someone goes in as a Civi Administrator and manually adds a second main contact, it would enforce that there is one because the default checkbox would be the only option.....



Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Using Webform to delete a Relationship ?
January 02, 2015, 11:00:39 am
Looks good, I'd say give it a try.
You could add a conditional rule to hide the contact 4 fieldset and only show it if the "end relationship" checkbox has been ticked for contact 3.
Try asking your question on the new CiviCRM help site.

DWGray

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.4.6 (in development)
  • CMS version: Drupal 7
  • MySQL version: unknown
  • PHP version: unknown
Re: Using Webform to delete a Relationship ?
January 03, 2015, 06:21:03 am
Afternoon Coleman and collective;

So I have been giving this a shot over the last 24 hours or so; it does not help that my works terminal is XP/IE8 either!
What I might do is use this thread as a bit of a blog or thought mapping process as it might help others in the future.

The first flaw I have come across is before we even look at the relationship management. The filters for the existing and new relationship holders allows the organisation admin to access our entire database of contacts where I would assume that checking the "Enforce Permissions" option would limit the selection.

As there would be one relationship holder I set this up as a static option, however I can only set the relationship automatically either as auto-from filters (which shows an incorrect result) or based on the relationship to the admin (where actually there is not one because the relationship is with the organisation)

So....

I switched the organisation to contact 1 and the admin to contact 2 does not seem to work because it hides all of the webform in place.

So I need to go back and find why the list of existing contacts is not being filtered by the relationship with the organisation....

Pages: [1] 2
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Using Webform to delete a Relationship ?

This forum was archived on 2017-11-26.