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 »
  • Webform, views and case activities
Pages: [1]

Author Topic: Webform, views and case activities  (Read 1279 times)

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Webform, views and case activities
November 22, 2014, 09:56:05 am
Thanks to petednz and demeritcowboy, I get to play around in CiviCase views.

I currently have an accordion view of all cases of a certain type.  The accordion title is the contact's last name and beneath that are case opened date and a couple of other fields.
 
In this view, I would like to add links to webforms to add case activities with the client's name populated in the webforms.  See image.  The "Add Meeting" link should go to the webform.

Having trouble getting the name to populate.

The Contact 2 webform element is set to static.  No matter what token I use, the name seems to come up "None Found." 

I searched extensively, but could not find an answer.

Any guidance from the masses?

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform, views and case activities
November 22, 2014, 04:45:34 pm
I'm not getting quite enough information from you to troubleshoot this. Who is Contact 2? The client? To populate them on the webform you need an "existing contact" field for them, and then pass cid2=xx in the url.
Big note about this: the Webform-CiviCRM module's behavior wrt cases and activities is getting a huge makeover in the next release. If you are playing around with this feature I recommend installing the 4.x-dev version on your sandbox (not sure if I'd recommend it for your live site). It has much more explicit "file on case" settings and also supports multiple activities.
Try asking your question on the new CiviCRM help site.

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 22, 2014, 05:43:27 pm
Hi Coleman, thanks for the reply.

Yes, Contact 2 is the client.  Existing contact is checked.

Tried
Quote
node/9?cid2=[id_1]

Url loads the webform with "None Found."

Am I forming the url correctly?

The contact2 field on the webform is set to static.

The new stuff sounds exciting...well maybe exciting isn't the right word.  But I'm sort of amped up to see it.  I'll install on development and play.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform, views and case activities
November 22, 2014, 06:37:39 pm
Url looks correct (assuming that views token is actually outputting a number) - can you check filters and persmissions on cid2's "existing contact" field?
Try asking your question on the new CiviCRM help site.

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 22, 2014, 08:55:40 pm
Filters:
Type of individual: none
Groups: smart group
Tags: none

Enforce permissions is checked.  User has full permission on case and contact.

I got it to work if I set Set default contact from to Auto: From Filters.
I hadn't even tried any of the default value items because I must have misunderstood:

Quote
Should the form be pre-populated with an existing contact?

    This setting will be overridden if a contact id is passed in the url, i.e. cid2=123

Is that the correct usage for the default value fields?

As far as the new stuff...

Does that mean that instead of creating a webform for each individual activity, I could do one webform and have them select the activity?

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 23, 2014, 03:12:35 am
For anyone who stumbles upon this thread, I just found the terrific documentation over on the Drupal module site.

I feel sheepish, but it never even crossed my mind to look on their site (I suppose I've spent too much time on this one).

Coleman's outstanding documentation Using Webform CiviCRM Integration 3 can be found here:

https://www.drupal.org/node/1615380

The Civi folks are truly amazing.

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform, views and case activities
November 23, 2014, 05:21:17 am
Quote
Does that mean that instead of creating a webform for each individual activity, I could do one webform and have them select the activity?
Yes :D

Quote
Coleman's outstanding documentation Using Webform CiviCRM Integration 3 can be found here
Even better documentation for Webform CiviCRM 4 is here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Webform+CiviCRM+Integration

Will do a few updates to it soon when v4.10 is released with the new features.
Try asking your question on the new CiviCRM help site.

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 23, 2014, 05:48:46 am
My bad...Webform 4

Once again, thanks Coleman!

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: Webform, views and case activities
November 23, 2014, 11:40:31 am
just to confirm for other passers-by yes a url like

node/46?cid2=[id_1]&cid3=[id_2]&cid4=[id_3]

will pre-load the form, assuming of course you have correctly constructed the 'drupal views relationships' correctly to get all those other interested parties loading in the view
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

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 23, 2014, 02:12:42 pm
Thanks Pete.  The url tricks are pretty cool.

And even more clarity...

This view will list all clients assigned certain case(s) in an accordion view with Last Name as title.
Info in accordion can include:
•   Date case opened
•   Case status
•   Date case closed
•   And more…
Create new View of type CiviCRM Cases

Create a relationship to:  CiviCRM Case Contact: Case Contact's Contact ID

Add fields:
CiviCRM Contacts: Display Name (Display Name) (use relationship)
CiviCRM Contacts: Contact ID (use relationship)
CiviCRM Contacts: First Name (use relationship)
CiviCRM Contacts: Last Name (use relationship)
CiviCRM Cases: Case Status (Case Status)
CiviCRM Cases: Start Date (Case Opened)
CiviCRM Cases: End Date (Case Closed)
Global: Custom text

The last field, Custom text is where you rewrite the url to the url of your webform followed by ?cid2=[id_1].
In our case:
node/9?cid2=[id_1]
(node/9 is the webform we want to populate with the client's name, cid2 is the second contact on the webform, and [id_1] is the token for the clients unique id)

Filter however you want.
We filter by Case Type  and Display Name (we exposed both filters so users could change which cases they see).

I used bootstrap accordion but it can be any view.  It looks pretty cool in isotope, but more practical for our use in an accordion.
« Last Edit: November 23, 2014, 04:38:33 pm by pmoz »

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: Webform, views and case activities
November 23, 2014, 02:16:54 pm
might help others to add a screenshot or two of your accordians?
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

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 23, 2014, 03:50:10 pm
That's funny, I was busy blurring while you wrote that!

Image is now attached of accordian with no styling.

pmoz

  • I post occasionally
  • **
  • Posts: 101
  • Karma: 2
  • CiviCRM version: 4.4.0, 4.5.3
  • CMS version: Drupal 7.34
  • MySQL version: 5.1.68
  • PHP version: 5.4.9
Re: Webform, views and case activities
November 24, 2014, 11:33:12 am
And even fancier documentation here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+case+activity+form+linked+from+a+view+of+case+clients
« Last Edit: November 24, 2014, 12:57:31 pm by pmoz »

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Webform, views and case activities
November 24, 2014, 11:39:01 am
Nice one. Added a link from the main documentation - called it "recipes" hopefully more people will be inspired to add their own recipes to the cookbook :)
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules »
  • Drupal Webform Integration »
  • Webform, views and case activities

This forum was archived on 2017-11-26.