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 Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Nearest Chapter Field?
Pages: [1]

Author Topic: Nearest Chapter Field?  (Read 376 times)

Scribbler2099

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7.24
  • MySQL version: 5.7
  • PHP version: 5.4.23
Nearest Chapter Field?
March 12, 2014, 02:09:18 pm
My non-profit has a lot of members who sign up through our website.  At our national office we like to put them in touch with their local chapter.  We usually have to do this by hand, searching for the nearest chapter to them, and e-mailing them with the contact info for the nearest chapter. 

I know civicrm has a 'proximity search' feature, I was wondering if it was possible to add a custom field to a member's contact that would show their nearest chapter.  Then when I do e-mail's, I can insert a 'nearest chapter' token, and I won't have to manually figure out what their nearest chapter is.

pkeogan

  • I post frequently
  • ***
  • Posts: 130
  • Karma: 4
    • BackOffice Thinking
Re: Nearest Chapter Field?
March 12, 2014, 07:20:58 pm
That should work,  are you having problems making it work for you?  You will need to populate it by hand though unless you write a hook or run a cron job (or both) to keep this updated.  The hook would work when a member joins or the members data is updated, the cron job could find an extraneous ones or work on imports.

If you have a lot of geo coding to do be careful if Google 2500 limit.


Scribbler2099

  • I’m new here
  • *
  • Posts: 25
  • Karma: 0
  • CiviCRM version: 4.4
  • CMS version: Drupal 7.24
  • MySQL version: 5.7
  • PHP version: 5.4.23
Re: Nearest Chapter Field?
March 13, 2014, 06:11:24 pm
Yea, I guess I was just hoping to avoid updating the 'nearest chapter' field by hand, because 1- that's a lot of member's who would need their nearest chapter set by hand and 1 - if they move I'll have an extra field to remember to update by hand. 

I'll have to play with the cron jobs, see if I can figure something out.  Either that or down the road we might have to hire someone to code a hook to do that.


Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: Nearest Chapter Field?
March 13, 2014, 07:10:57 pm
If you have it working by hook then you can write a job / api that goes through & saves each contact (which would call the hook) e.g.

https://github.com/eileenmcnaughton/nz.co.fuzion.eventactivities/blob/master/api/v3/Job/FillEventActivities.php calls
https://github.com/eileenmcnaughton/nz.co.fuzion.eventactivities/blob/master/eventactivities.php#L278

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Nearest Chapter Field?

This forum was archived on 2017-11-26.