Forums

DBSave: retrieving the cf_id of the saved form

davecoventry 19 Feb, 2014
If I save the contents of a form using the DBSave component, is it possible to retrieve the cf_id of that table entry?
davecoventry 19 Feb, 2014
Please accept my apologies.

Searching in the forums using the keyword cf_id turned up this article here, which answers my question.

Sorry.

Dave
GreyHead 19 Feb, 2014
Hi Dave,

The search box on the FAQs page (which uses MijoSearch) is pretty good now, that's a good place to start. I use it all the time to find FAQs, forum search isn't too bad either.

Bob
vales 31 Mar, 2014
In chronoform v5 I have not found the item $form->data ['id'].

There is an alternative method to retrieve the id of the record saved?
Max_admin 01 Apr, 2014
Hi Vales,

That's not available in v5 but I have just added it and you may contact me for a patch, however, you can also get that value using the code below:

\GCore\Models\MODEL_ID_HERE::getInstance()->id


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
vales 06 Apr, 2014
Hello Max,
thanks for the suggested solution. At the moment it is sufficient that one.
I would recommend to find in future versions also a method to retrieve the auto-generated fields in the table:

created, modified, user_id

they may be useful in the template of the email, or other uses.

Regards, Vales
Max_admin 07 Apr, 2014
Hi Vales,

No problems, but the other values can be acquired using normal PHP:

$created = date("Y-m-d H:i:s", time());
$user = JFactory::getUser(); //id = $user['id']


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.