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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom field drop-down linking to subquery
Pages: [1]

Author Topic: Custom field drop-down linking to subquery  (Read 3257 times)

dwilliu1

  • Guest
Custom field drop-down linking to subquery
February 05, 2009, 09:31:06 am
Hi,
I am needing to create a new custom field that is an option list or drop-down where the values in the list are pulled from a different table/subquery?
Is this possible to do, if so, how?

Thanks!

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field drop-down linking to subquery
February 05, 2009, 10:02:02 am

not possible in a easy manner right now. you might need to hack the code in a few places to enable this (and make it conditional on the name of your custom field etc). If you'd like to pursue this option (not recommended), contact us on IRC

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dwilliu1

  • Guest
Re: Custom field drop-down linking to subquery
February 05, 2009, 10:32:04 am
Well here's the case, and maybe you can tell me what you think... and any new concepts this idea would introduce.

- Consider an event that is something like participating at a camp.
- Assume possible participant roles to be either a camper or a counselor
- Upon initial registration for the event, whether as a camper or counselor, the participant status should be set to pending...
- Pending status means there is an action to follow by the administrator, in this case it would be the camp registrar, to determine the final selection of who is actually going to attend and participate at the camp

So I think CiviCRM can easily take it to this point, correct?

Here's part 2... the interactive part where someone managing the event would solidify the participants and roles, and pair campers to counselors...

- First step, finalize the list of participants of campers and counselors... simply setting the participant status for the event to "confirmed" or something similar
- You then would have two types of participants registered under the same event, but now it is critical for those to be linked in order to finalize the event so that campers can be assigned counselors, and vice versa.
- As an example, all registered participants to the event having role = Camper, should have a corresponding field automatically created that defines the set relationship of the camper to a counselor for the event... this is more or less a type of relationship
- The same requirement would be true for counselors, except they could have multiple campers assigned to them

The only way to achieve the above thing would be by having dynamic field elements that can driven by custom rules/workflows based on simple to define guidelines!

Even though the example is specific, I would think the need for non-profit organizations to have a feature like this would be extremely value added. Getting an event up and running is one thing, but actual management and operating of that event efficiently requires there to be some basic enhanced features like this.


Lobo - can you tell me whether this idea has been proposed in the past, and if so, what the general thinking/feedback for it has been?

I personally think the concept is simple and generic enough where a basic design of this feature could be implemented - if it were sponsored and had the backing/support of the community.

Do you think others would agree?

« Last Edit: February 05, 2009, 10:49:24 am by dwilliu1 »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field drop-down linking to subquery
February 05, 2009, 12:17:37 pm

I think making the system more flexible and allowing developers to modify / extend the system is always a good thing :)

So adding a hook to make "option elements" for a custom group be a dynamic query is potentially the way to go. I dont think it should be too hard, but would require someone to abstract out what we currently have and write a nice interface that we can "hook-ify"

if you are interested in working on this / sponsoring this contact us on IRC

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dwilliu1

  • Guest
Re: Custom field drop-down linking to subquery
February 05, 2009, 02:10:14 pm
Great... just so I know, when is the best time to get on IRC for chatting about this?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field drop-down linking to subquery
February 05, 2009, 02:24:36 pm

we are around for a large part of the day, definitely during PST day time hours (10:00 - 4:00)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

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: Custom field drop-down linking to subquery
February 05, 2009, 03:16:44 pm
jeeks - they have short days in California. was that meant to be 4am to 10 pm?  ;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

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Custom field drop-down linking to subquery
February 05, 2009, 08:53:38 pm

short days help :) a bike ride helped clear my head, and voila a new issue:

http://issues.civicrm.org/jira/browse/CRM-4094

i'll try to push this in for 2.2 beta2 :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

dwilliu1

  • Guest
Re: Custom field drop-down linking to subquery
February 06, 2009, 12:04:51 am
short days do rock

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Custom field drop-down linking to subquery

This forum was archived on 2017-11-26.