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 (Moderator: Donald Lobo) »
  • Using Views for Contributions and Custom Data
Pages: [1]

Author Topic: Using Views for Contributions and Custom Data  (Read 690 times)

markimus

  • I post occasionally
  • **
  • Posts: 75
  • Karma: 0
Using Views for Contributions and Custom Data
November 26, 2011, 11:17:54 am
I am trying to build a very simple integration for Contributions and Custom Data.

I have been able to build a view that pulls all contributors contributing to a specific source code [ie project] using views and views calc.
I have also built a custom data tab in a staffs profile [project leader] with expenses for each month of the year  -ideally  that would subtract from the projects total contributions thus giving the project leader an idea where they stand on their budget
I want to now add the custom data to the view but I cant bring the two together without getting this error "Unknown column 'civicrm_contact.custom_37' in 'field list' query:"
I figured out that the reason is that the custom data is related to an individual contact 'view'  as opposed to a contributions 'view' [although it shows up as available in the list] 
Is there a way to merge these together or build a view that can use both contributions and custom data in one?
Success is the ability to go from one failure to another with no loss of enthusiasm.

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Using Views for Contributions and Custom Data
November 27, 2011, 11:08:51 am
> Is there a way to merge these together

No, because your view is based on Contributions. Each has a relationship to the project leader Contact (or that's what it sounds like) and so Views can pull that Contact record into your View. But you are now asking to pull data from a third table, which is related to the Contact. Views can not (at least with CiviCRM) do a two-step relationship like that.

> or build a view that can use both contributions and custom data in one?

What you could do would be to use a bit of custom PHP in one of your View's templates. There you can access the Contact ID of the project leader (that's part of your View or can be added) and then use the API to pull in his custom fields.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Drupal Modules (Moderator: Donald Lobo) »
  • Using Views for Contributions and Custom Data

This forum was archived on 2017-11-26.