In my extension (it's the first one I'm writing) I have the need to create a new DB table and to manage it (insert, update, delete records). How can I do it? Thanks Marcello
1 Answer
Check this section on the wiki: https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension#CreateaModuleExtension-Addadatabaseupgrader/Installer/uninstaller You will need to add an upgrader to your extension, and from that upgrader you can manage your database file installs. Also, you might want to add a DAO class?
-
Thank's ErickH, I had already read that section and I'm able to create/destroy my table on the DB and I made some web forms. My problem Is now how to create: 1) a table element list page with buttons Add, Modify ... 2) an edit form. There are some examples or maybe a some code page I can use to start?– marcelloApr 21, 2016 at 16:52
-
-
You certainly can, but it might make life easier if you do. It depends on what you want to do with your table. If I want to use it in a form and page etc. having a DAO actually helps me. Apr 23, 2016 at 13:23