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) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Development needed if want to show custom field only on certain conditions
Pages: [1]

Author Topic: Development needed if want to show custom field only on certain conditions  (Read 885 times)

Markus Hapke

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.0
  • CMS version: Drupal
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Development needed if want to show custom field only on certain conditions
November 23, 2013, 03:34:00 pm
Hello developers,

The problem: ::)
A customer field-set contains some customer fields ( used for contacts) .

I want to make this fields visible only on a certain condition ( e.g. contact is member of group 'Complainers' . (or
has tag xy, or sth. else) )

Adding these fields to a Profile and assign them (via Advanced settings) to the Group doesn't have the expected effect !

Can I do this by configuering or is development neccessary?

Thanx in advance,
 Markus



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: Development needed if want to show custom field only on certain conditions
November 23, 2013, 03:43:56 pm
Hi Markus - perhaps a bit more info - eg is this for 'self service' - sounds like it is.

No way currently through civi afaik but you might get closer via Webform CiviCRM now since you can in theory do something like this

If user is logged in, then set webform to prefill with info about current user

if current user has tag = x or group = y, then use webform conditional settings to opt whether or not the custom fields show.

not tried this but would be something i would explore before going down custom code - i expect if this is on civi side then you need some custom js that is doing the conditionality.
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

Markus Hapke

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.0
  • CMS version: Drupal
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Re: Development needed if want to show custom field only on certain conditions
November 23, 2013, 11:53:52 pm
Hello Petednz,

These fields are not for self-service, but internal data mastering. The user of the contact isn't logged on.

My requested invisiblity is 'nice to have' for clearity .

I'm new to CiviCRM, so if web-forms have to be implemented on our drupal - site, I am not plannig to
go into that.

What is the use in  'Advanced settings' when relating a Profile to certain groups? Wouldn't that lead to
a restriction?

Thanks,
 Markus


planetwebb

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28 / Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.22
Re: Development needed if want to show custom field only on certain conditions
November 24, 2013, 10:17:58 am
Markus,

I had a similar requirement for an event registration.  We wanted the volunteer to provide their work preference when registering (custom field #1) and a back office custom field (#2) for their actual work assignment that would be determined by the volunteer coordinator based on loading.  You want to show field #1 but not field #2 to the registrant.  I found an easy way through Webforms since you can select what fields you want to expose...works great.

Keith

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: Development needed if want to show custom field only on certain conditions
November 24, 2013, 10:45:46 am
Markus - hi - sorry I am not really understanding the use case.

Admin wants an interface that has fields, but only some fields would show if you are editing Contact A, but other ones would show if you are editing Contact B?
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

Markus Hapke

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.0
  • CMS version: Drupal
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Re: Development needed if want to show custom field only on certain conditions
November 25, 2013, 03:42:54 am
Hello again

@petednz:
 Planetwebb describes it in a good way.
 Any Service user maintains a Contact's data and should see only such fields which are relevant for
 this single Contact.
 Example: if the Contact hasn'd complained yet, he is not in Group "Complainers" (or has no such Tag)
 and hence the service user doesn't need to see all complaint-related (customer-) fields.

 Does webforms mean programming ? (OK, I guess I should gather such info at other places..)
 Could this webform manage only the (complaint) part of all of the contact data, or do I need to replace
 the whole contact-data related field-set?

 Best regards,
  Markus Hapke
 

planetwebb

  • I post occasionally
  • **
  • Posts: 62
  • Karma: 2
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28 / Drupal 7.34
  • MySQL version: 5.5.34-cll-lve
  • PHP version: 5.3.22
Re: Development needed if want to show custom field only on certain conditions
November 25, 2013, 05:00:42 am
Marcus,
Check out https://drupal.org/project/webform_civicrm and you'll also find plenty of reference within this forum. There are a few trade-offs but the benefits far out way and no programming.

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Development needed if want to show custom field only on certain conditions
November 25, 2013, 08:37:44 am
Hi,

I'm not super sure it applies to your case, but you can create contact subtypes (eg. vip users, press, politicians...) and for each of these subtypes, create custom sets of fields.

these fields are only visible if the contact is of this subtype, so for instance if you have a custom field "minimal amount to bribe" you will have it only for those of subtype politicians. This is assuming that the press has more integrity than politician, that might be another topic of discussion.

Anyway, you can try if it works for you with subtypes and custom fields

-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

Markus Hapke

  • I’m new here
  • *
  • Posts: 14
  • Karma: 0
  • CiviCRM version: 4.3.0
  • CMS version: Drupal
  • MySQL version: MySQL 5.1
  • PHP version: PHP 5.3
Re: Development needed if want to show custom field only on certain conditions
November 25, 2013, 11:39:54 am
Hello Xavier, Planetwebb

Planetwebb: Thank you, I' ll take a look at it.

Xavier:
Though a good proposal (I guess it would be sufficient for our problem)
  But:   I cannot find such a
   relation :
  custmer Field group <-> contact type ? 
  Where is it? If I assign the field group it to contacts, no subtype - dropdown menu is offered ?

 Thx again,
 Markus

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: Development needed if want to show custom field only on certain conditions
November 25, 2013, 01:05:02 pm
have you made your self some contact sub-types and they are not showing? even with a new field?
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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion (Moderator: Donald Lobo) »
  • Development needed if want to show custom field only on certain conditions

This forum was archived on 2017-11-26.