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 (Moderator: Dave Greenberg) »
  • Adding an Application ID field on the Grant Tab
Pages: [1]

Author Topic: Adding an Application ID field on the Grant Tab  (Read 1419 times)

Jrichardson

  • Guest
Adding an Application ID field on the Grant Tab
September 26, 2009, 01:01:16 pm
Hi --
I need to numerically identify grant applications made.  Is there a way to create an autonumber function or display the GrantID number to specifically identify each grant application made?

I have created some other custom fields but am not sure how to do this.  Suggestions would be appreciated.

Thanks In Advance !

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: Adding an Application ID field on the Grant Tab
September 27, 2009, 07:48:41 am

You could create a custom field of type view (php code). Once the column has been created, you can alter the sql to make it an autoincrement field. Alternatively you can write a custom field hook to do set the grant id. I think "altering" the column is a bit cleaner and easier :). In either case you will need some sql/php knowledge

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

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Adding an Application ID field on the Grant Tab
September 28, 2009, 10:59:39 am
If what you need is just to display a unique number for each Grant in CiviGrant - then you can potentially use the civicrm_grant primary key - which is available as a smarty variable - {$id} - in the both View and Edit Grant screens, and as {$row.grant_id} in the Grant tab listing.

 (Then you only need to create a custom version of these templates and expose the grant id somewhere in the template.)
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM (Moderator: Dave Greenberg) »
  • Adding an Application ID field on the Grant Tab

This forum was archived on 2017-11-26.