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 CiviReport (Moderator: Dave Greenberg) »
  • Getting custom fields for the target contact on Activity report
Pages: [1]

Author Topic: Getting custom fields for the target contact on Activity report  (Read 781 times)

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Getting custom fields for the target contact on Activity report
August 08, 2011, 08:37:54 pm
I am working on this report:
Quote
CRM/Report/Form/Activity.php

When I add Custom fields for "Contact" like so:
Code: [Select]
protected $_customGroupExtends = array( 'Activity', 'Contact' );
The custom fields are for the Source contact (the person creating the activity) not the target of the Activity.  I'd like to get the custom fields for the target.

Any ideas on how to do this?  Thanks!
Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Getting custom fields for the target contact on Activity report
August 09, 2011, 02:40:43 am
If I had to guess, it will need fare amount of code customization

Kurund
Found this reply helpful? Support CiviCRM

CiviTeacher.com

  • I live on this forum
  • *****
  • Posts: 1282
  • Karma: 118
    • CiviTeacher
  • CiviCRM version: 3.4 - 4.5
  • CMS version: Drupal 6&7, Wordpress
  • MySQL version: 5.1 - 5.5
  • PHP version: 5.2 - 5.4
Re: Getting custom fields for the target contact on Activity report
August 09, 2011, 10:53:29 am
Thankfully it wasn't that involved.  FYI this is how I did it.  I changed the 'contact_civireport' to the target contact, as opposed to the source contact. 'contact_civireport' must be the alias that is automatically used with custom fields.    This involved a search and replace that resulted in 7 or 8 changes.

Attached is an example of the file.  This was taken and altered from the 3.4.5 codebase.



Try CiviTeacher: the online video tutorial CiviCRM learning library.

Kurund Jalmi

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4169
  • Karma: 128
    • CiviCRM
  • CiviCRM version: 4.x, future
  • CMS version: Drupal 7, Joomla 3.x
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Getting custom fields for the target contact on Activity report
August 10, 2011, 03:16:33 am
Kool, thanks
Found this reply helpful? Support CiviCRM

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviReport (Moderator: Dave Greenberg) »
  • Getting custom fields for the target contact on Activity report

This forum was archived on 2017-11-26.