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 Profiles (Moderator: Dave Greenberg) »
  • How can I populate a custom date field with current date/time?
Pages: [1]

Author Topic: How can I populate a custom date field with current date/time?  (Read 1170 times)

smallbiz

  • I post occasionally
  • **
  • Posts: 43
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: Joomla 2.5, 3.3
  • MySQL version: 5
  • PHP version: 5.2
How can I populate a custom date field with current date/time?
June 21, 2013, 08:19:19 am
Seems to me it would be great if civiCRM had a custom field called "TimeStamp", but alas, there isn't.

So here's my issue, I have a profile we are using to collect information from individuals who want to be Volunteers.

My client wants to run a monthly report where they can filter by "date submitted". If there was a custom field called "TimeStamp", then we could filter on that to retrieve only Profiles created during a specific date range.

In lieu of the above, is there a way I can populate a custom date field with the current timestamp at the time the profile is submitted? Of course, we'd not want this field to be edittable by the user, but it must be searchable via the backend.

Any ideas how I can accomplish this?

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: How can I populate a custom date field with current date/time?
June 23, 2013, 11:00:17 am
"You can make a custom field read-only and then set its value from a hook" : http://book.civicrm.org/developer/current/techniques/hooks/
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Profiles (Moderator: Dave Greenberg) »
  • How can I populate a custom date field with current date/time?

This forum was archived on 2017-11-26.