Limiting the date selection
Collapse
X
-
I think yes they are the fields names,
belgeTarihi = Document Date
Kayittarihi = Record Date
Translated from Turkish, hope I translated correctly
-
Hi,
I used a pretty simple method
I first created the application / Espo / Hooks / Volvox / datecontrol.php file.
Then I simply used the code below. and worked
PHP Code:<?php namespace Espo\Hooks\Volvox; use Espo\ORM\Entity; use \Espo\Core\Exceptions\Error; class datecontrol extends \Espo\Core\Hooks\Base { public function beforeSave(Entity $entity, array $options = array()) { if ($entity->isNew()) { $belgetarihi=$entity->get('belgeTarihi'); $kayittarihi=$entity->get('kayittarihi'); $monthb = date("m",strtotime($belgetarihi)); $monthk = date("m",strtotime($kayittarihi)); if($monthb!=$monthk) { throw new \Exception("wrong month!"); } } } }Leave a comment:
-
Limiting the date selection
Hello there,
I want to choose a day for the date field only in the month we are in. Is this possible? It will give an error when choosing next or past month ...Tags: None

Leave a comment: