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) »
  • Re-ordering and collapsing all but latest of multiple records
Pages: [1]

Author Topic: Re-ordering and collapsing all but latest of multiple records  (Read 811 times)

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-ordering and collapsing all but latest of multiple records
March 25, 2010, 10:49:42 am
We have a multiple record field that is used to capture the 'current' information regarding residence - when they move a new record is created. We would like the newest record to be at top, whereas default it adds to the bottom - and ideally would collapse all but the newest record - any suggestions? tks
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: Re-ordering and collapsing all but latest of multiple records
March 25, 2010, 12:55:16 pm

Check the SFSchool module. i've done something similar for a multiple custom group record and rearrange the order of fields in the tpl. I do some sorting in the php code to make the tpl code trivial

ping me on IRC for more details (or search for customdataview in the .module)

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: Re-ordering and collapsing all but latest of multiple records
March 30, 2010, 02:21:39 am
Thanks Lobo - it looks like because of the limitations around searching and importing we will go for a simple field instead.

If we aren't worried about data loss, is there any downsides/risks to just changing the field type in the back end from multiple to non-multiple?
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: Re-ordering and collapsing all but latest of multiple records
March 30, 2010, 06:28:04 am

no harm in doing so in the DB. You should also  add a UNIQUE constraint to the entity_id field if you switch to a single value field

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

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Re-ordering and collapsing all but latest of multiple records

This forum was archived on 2017-11-26.