Update date field on change

mmaresca

Member
I have an order entry database that works fine. I have a field called “approval” with 3 choices: pending, approved or denied. It is a select single radio button field. I also have a field for approval date. I would like to insert the current date intro the approval date field when the order is approved or denied. I cannot seem to write the function correct to make that happen. Any advice?


Your current DaDaBIK version​

You are using DaDaBIK version 10.3-Manarola enterprise, installed on 10-31-2020 (installation code: 161525f9d843a6507f), the latest version of DaDaBIK is 11.8-Elba released on 12-05-2022

System info
PHP Version: 7.4.3
mysql version: 8.0.32-0ubuntu0.20.04.2
Web server: Apache/2.4.41 (Ubuntu)
Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
URL installation: xxxxxxxxxxxxxxxx
 

mmaresca

Member
Well, not really. There should be a way within dadabik to insert _after, which I have done before but not using a single select radio as a trigger. Just can’t seem to find the correct code structure.
 

Martin68

Well-known member
That should be a hook, look at chapter 10.8 of the documentation... unfortunately I don't have any experience with these hooks, cause prefer a in-database-solution.

Martin
 

mmaresca

Member
Thank you. I will dig into that today. I have used hooks before but I have not been able to find the correct code structure for this situation.
 
Top