Forums

how to save the creation date in CFv5

Sharu 26 Sep, 2014
Hello!
how can I save the creation date in Chronoforms V5 to database. In Chronoforms V4, there was enough to enter the field in the database "cf_created". Maybe there is some simple solution for V5.
GreyHead 27 Sep, 2014
Hi Sharu,

In CFv5 it is just 'created' and 'modified' for the modification date.

Bob
Sharu 27 Sep, 2014
thanks for the answer.
I added fields: 'created' and 'modified'. Selected type in fields = 'datetime', but it's still does not save them.
Maybe somewhere in the settings to turn on?

Array
(
    [chronoform] => resume5
    [event] => submit
    [Itemid] => 707
    [option] => com_content
    [view] => article
    [catid] => 93
    [id] => 194
    [fio] => uuuuuu
    [text] => uuuuuuu
    [button3] => Отправить
    [mail] => rr4rr@rr4rr.com
    [resume5] => 
    [cf_id] => 61
)

Debug Info:
Array
(
    [2] => Array
        (
            [DB Save] => Array
                (
                    [Queries] => Array
                        (
                            [0] => INSERT INTO `qhksj_bresume` (`fio`, `text`, `mail`) values ('uuuuuu', 'uuuuuuu', 'rr4rr@rr4rr.com');
                        )

                )

        )

)
Sharu 27 Sep, 2014
Table `qhksj_bresume` in DB was created manually.
GreyHead 27 Sep, 2014
1 Likes
Hi Sharu,

Please try clicking the Delete cache icon in the Forms Manager toolbar. That should clear ChronoForms ld table settings record.

Bob
Sharu 27 Sep, 2014
Thanks Bob
After the automatic creation of the table through toolbar, everything is working in menu.
But when I show the form via a plugin in article, it thinks I'm trying to modify the table. But I need to add a new entry


[Queries] => Array
                        (
                            [0] => UPDATE `qhksj_bresume` AS `Data` SET `firstname` = 'ggg', `lastname` = 'ggg', `age` = '55', `city` = 'ggg', `user_id` = '42', `modified` = '2014-09-27 18:08:17' WHERE `id` = '194';
                        )
GreyHead 27 Sep, 2014
Answer
1 Likes
Hi Sharu,

This is a problem with the Article ID from the page URL getting mixed up with the record ID. For some reason Max decided to make the default Primary Key in CFv5 id instead of cf_id.

There are two ways to solve it, either change the column name in the table from id to say cf_id; or add a Custom Code action in the On Submit event to unset the 'bad' id:
<?php
unset($form->data['id']);
?>

Bob
Sharu 27 Sep, 2014
thank you very much Bob
This topic is locked and no more replies can be posted.