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 similar to "current employer" field
Pages: [1]

Author Topic: Custom field similar to "current employer" field  (Read 639 times)

adrian.mahlstein

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
Custom field similar to "current employer" field
August 16, 2012, 01:05:27 am
Dear all

I am trying to set up a custom field, which is similar to the "current employer" out-of-the-box field.

The field needs to be displayed in public to anonymous users, therefore the "contact reference autocomplete" field cannot be used.

My aim is to set up a "text field" that automatically creates a new organization if it doesn't exists yet.

Unfortunately, I couldn't find any information regarding this subject in the web.

Would be very grateful for your support.

Best,
Adrian

JonGold

  • Ask me questions
  • ****
  • Posts: 638
  • Karma: 81
    • Palante Technology
  • CiviCRM version: 4.1 to the latest
  • CMS version: Drupal 6-7, Wordpress 4.0+
  • PHP version: PHP 5.3-5.5
Re: Custom field similar to "current employer" field
August 16, 2012, 07:53:46 am
Hi Adrian,

The "current employer" field is a bit of a special case, so unfortunately you can't point-and-click your way to this.  Folks have talked about expanding this functionality to arbitrary relationships, but it hasn't happened yet.

However, what you're trying to do is a fairly easy intro to hooks, and could be done in a few lines of PHP.  Check out hook_civicrm_post:
http://wiki.civicrm.org/confluence/display/CRMDOC41/CiviCRM+hook+specification#CiviCRMhookspecification-hookcivicrmpost

Jon
Sign up to StackExchange and get free expert CiviCRM advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

adrian.mahlstein

  • I’m new here
  • *
  • Posts: 8
  • Karma: 0
  • CiviCRM version: 4.1
  • CMS version: Drupal 7
Re: Custom field similar to "current employer" field
August 18, 2012, 02:35:41 am
Hi Jon

Thanks for the quick reply. I suspected this to be the case... ;)

I will have a look at hook_civicrm_post and try to resolve things that way.

Best,
Adrian

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: Custom field similar to "current employer" field
August 19, 2012, 07:02:39 am
Why not just rename "current employer" to something else?
Try asking your question on the new CiviCRM help site.

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

This forum was archived on 2017-11-26.