Answers.Body: <p>It looks like they are activities (new type investment), with a custom field (amount) and that should get you covered without the need of coding anything.</p>
  
  <p>As for the reporting, as you know sql, I would suggest you to create a custom dataviz using <a href="https://civicrm.org/extensions/civisualize-missing-data-visualization-extension" rel="nofollow">https://civicrm.org/extensions/civisualize-missing-data-visualization-extension</a> (you'll need a bit of javascript to do the graphs, but that's a handful of lines)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-13T17:13:51.197Z
Answers.Text: I wanted to use custom data on Organizations because I have many other fields tied to organizations that are easily incorporated into reports with the CustomGroupExtends = array('Organization') designation. I love civizualize (Thanks for all your work) but it requires customization and I like that I can quickly add custom fields into a report as they are created with the CustomGroupExtends feature. I use civizualize for Dashboards and it works very well.
Answers.UserDisplayName: Vito Mantese
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-12T07:54:25.063Z
Answers.LastActivityDate: 2016-04-12T07:54:25.063Z
Answers.UserDisplayName: Xavier
Body: <p>What is the easiest way to add a custom field that contains multiple contact references a la Activity Target Contacts.</p>
  
  <p>I.E.</p>
  
  <p>Custom Data:::::Extends Organizations<br>
  Field Set Name: Investment Round</p>
  
  <p>Custom Field 1 Title: Amount Raised<br>
  Custom Field 1 Type: Money</p>
  
  <p>Custom Field 2 Title: Raised Date<br>
  Custom Field 2 Type: Date</p>
  
  <p>Custom Field 3 Title: Investor(s)<br>
  Custom Field 3 Type: Contact References</p>
  
  <p>If this doesn't exist as a quickhack I could consider working on this if there was support for the idea. It seems like it would involve creating a helper table with the following columns.</p>
  
  <pre><code>CREATE TABLE `civicrm_custom_contact`(
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Custom Field ID',
    `custom_field_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_custom_group.',
    `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contact.',
    PRIMARY KEY (`id`),
    UNIQUE KEY `field_contact_id` (`custom_field_id`,`entity_id`),
    KEY `FK_civicrm_custom_contact_custom_field_id` (`custom_field_id`),
    KEY `FK_civicrm_custom_contact_contact_id` (`entity_id`),
    CONSTRAINT `FK_civicrm_custom_contact_custom_field_id` FOREIGN KEY (`custom_field_id`) REFERENCES `civicrm_custom_field` (`id`) ON DELETE CASCADE
    CONSTRAINT `FK_civicrm_custom_contact_contact_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci 
  </code></pre>
  
  <p>making a table which looks like</p>
  
  <pre><code>    id| custom_field_id | entity_id
      1 | 12              | 123
      2 | 13              | 4232
  </code></pre>
  
  <p>id is the primary key,<br>
  custom_field_id is the foreign key to the civicrm_custom_field table,<br>
  entity id is the foreign key to the civircm_contact table. </p>
  
  <p>In this way we could link multiple contacts to a custom field similar to the way multiple contacts are added to an activity. </p>
  
  <p>So, to recap, is there an existant way to do this, and if not, would anyone be interested in working on this with me?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T18:51:25.500Z
Comments.Text: Can you explain what are the downsides of doing the above as an Activity? It looks like an activity, it sounds like an activity ;-)
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T19:10:30.567Z
Comments.Text: We use custom fields on an activity that bins contacts in a particular way. For example, participants in an activity who had a particular role - it'd be great if I could have the "with" box but as custom data...
Comments.UserDisplayName: Cheryl
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T19:16:49.660Z
Comments.Text: @petednz How easy is it to build reports off of an activity? And is it easy to join those to non-activity custom data?
Comments.UserDisplayName: Vito Mantese
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T19:18:14.590Z
Comments.Text: If you are on Drupal I would say 'easy' and then do it through Views.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T19:19:50.043Z
Comments.Text: It may also help if you ask 'what is the easiest way to achieve the following outcome' and detail the outcome you need.
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-04-11T19:41:35.110Z
Comments.Text: The outcomes are many is sort of the issue. I want to be able to create investments that are themselves sub-entities of investment rounds. I want to be able to report on those investments in combination with other custom data such as grants that those companies have received and if they are at a certain address. You are correct that activities seem to be the most natural fit for an 'investment' but custom data extending a contact was a quicker route(until I hit this question's roadblock).
Comments.UserDisplayName: Vito Mantese
Tags: <contacts><custom-fields><contact-reference>
Title: Custom Data: Multiple Contact References
ThreadText: # Custom Data: Multiple Contact References
  
  (Asked by: username_0 on 2016-04-11)
  
  What is the easiest way to add a custom field that contains multiple contact references a la Activity Target Contacts.
  I.E.
  Custom Data:::::Extends Organizations
  Field Set Name: Investment Round
  Custom Field 1 Title: Amount Raised
  Custom Field 1 Type: Money
  Custom Field 2 Title: Raised Date
  Custom Field 2 Type: Date
  Custom Field 3 Title: Investor(s)
  Custom Field 3 Type: Contact References
  If this doesn't exist as a quickhack I could consider working on this if there was support for the idea. It seems like it would involve creating a helper table with the following columns.
  CREATE TABLE `civicrm_custom_contact`(
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Custom Field ID',
    `custom_field_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_custom_group.',
    `entity_id` int(10) unsigned NOT NULL COMMENT 'FK to civicrm_contact.',
    PRIMARY KEY (`id`),
    UNIQUE KEY `field_contact_id` (`custom_field_id`,`entity_id`),
    KEY `FK_civicrm_custom_contact_custom_field_id` (`custom_field_id`),
    KEY `FK_civicrm_custom_contact_contact_id` (`entity_id`),
    CONSTRAINT `FK_civicrm_custom_contact_custom_field_id` FOREIGN KEY (`custom_field_id`) REFERENCES `civicrm_custom_field` (`id`) ON DELETE CASCADE
    CONSTRAINT `FK_civicrm_custom_contact_contact_id` FOREIGN KEY (`entity_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=170 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci 
  
  making a table which looks like
      id| custom_field_id | entity_id
      1 | 12              | 123
      2 | 13              | 4232
  
  id is the primary key,
  custom_field_id is the foreign key to the civicrm_custom_field table,
  entity id is the foreign key to the civircm_contact table. 
  In this way we could link multiple contacts to a custom field similar to the way multiple contacts are added to an activity. 
  So, to recap, is there an existant way to do this, and if not, would anyone be interested in working on this with me?
  
  **Tags:** contacts, custom-fields, contact-reference
  
  > **Comments:**
  > **username_1**: Can you explain what are the downsides of doing the above as an Activity? It looks like an activity, it sounds like an activity ;-)  
  > **username_2**: We use custom fields on an activity that bins contacts in a particular way. For example, participants in an activity who had a particular role - it'd be great if I could have the "with" box but as custom data...  
  > **username_0**: @petednz How easy is it to build reports off of an activity? And is it easy to join those to non-activity custom data?  
  > **username_1**: If you are on Drupal I would say 'easy' and then do it through Views.  
  > **username_1**: It may also help if you ask 'what is the easiest way to achieve the following outcome' and detail the outcome you need.  
  > **username_0**: The outcomes are many is sort of the issue. I want to be able to create investments that are themselves sub-entities of investment rounds. I want to be able to report on those investments in combination with other custom data such as grants that those companies have received and if they are at a certain address. You are correct that activities seem to be the most natural fit for an 'investment' but custom data extending a contact was a quicker route(until I hit this question's roadblock).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_3 on 2016-04-12. Score: 1
  
  It looks like they are activities (new type investment), with a custom field (amount) and that should get you covered without the need of coding anything.
  
  As for the reporting, as you know sql, I would suggest you to create a custom dataviz using <https://civicrm.org/extensions/civisualize-missing-data-visualization-extension> (you'll need a bit of javascript to do the graphs, but that's a handful of lines)
  
  > **Comments:**
  > **username_0**: I wanted to use custom data on Organizations because I have many other fields tied to organizations that are easily incorporated into reports with the CustomGroupExtends = array('Organization') designation. I love civizualize (Thanks for all your work) but it requires customization and I like that I can quickly add custom fields into a report as they are created with the CustomGroupExtends feature. I use civizualize for Dashboards and it works very well.  
  
  ---
  
  