2

I have a custom field of type Date used for activities, even though i have set years prior to current date to 0, it still allows users to select past day and month of the current year.

Is there any quick fix for this, can anyone give me a hint?

CiviCRM 4.6.33

2

I think you'll need an extension for this. Use the hook_civicrm_validateForm if you just need to prevent prior dates from being entered on the back-end activity form. If you need to block ALL forms of adding a prior date, you may want to use the hook_civicrm_pre hook (this will block Webform-CiviCRM, API, etc.).

You may want to set exclusions for administrators if you do this!

| improve this answer | |
  • thank you @Jon, i just need to prevent prior dates from being entered on the back-end activity form. I will have to look into the extension though i have no experience writing extensions. Wonder if there is any other easy way out:) – Kboy Oct 22 '17 at 13:41
  • If you want to customize CiviCRM, developing an extension is the way to go. Any shortcut might work, but is usually in the way when upgrading, possibly interferes with core code and is not transparant if any one else takes a look. So please invest a little time to study how to create an extension. – ErikH - CiviCooP Oct 23 '17 at 7:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.