Forums

cf_id to be retrieved

rashmani 20 Jan, 2011
Hi there,

I've been on ChronoSearch for a while, looking for the right way to get newly created cf_id after my my form get submitted. So I used this code in my OnSubmit after email (DB saved before mail):

$MyForm =& CFChronoForm::getInstance();
$id = $MyForm->tablerow["jos_chronoforms_MyForm"]->cf_id;
echo "This should be record no. ".$id."!<br />";


But I always get an empty $id var. What am I doing worng?

Cheers,
rash*
GreyHead 20 Jan, 2011
Hi rashmani,

That looks good to me. Please double check that the table name is correct??

By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.

Bob
rashmani 20 Jan, 2011
Hi all,

this has been solved offline, thanks to Bob putting the correct run order in my form.
I just want to thank Bob for his great job, always over expectations.

Ciao!
rash*
srthomas 26 Jan, 2011
Hi Rashmani,

Could you shared the modified code as this is exactly what I'm looking for?

Thanks,
Steve
rashmani 24 May, 2011
Hi Steve,

apologize for late replying, not very often here bugging GreyHead days... ;-)
Anyway, while hoping you solved, there were no modifications to the code I've posted. The issue was in Run Order tab: by changing run order of components, my code was executed (last, if I remember well) and var correctly dispatched to the target page.
Since then, I've learned to include a check to run order whenever post-submit issues are raising.
Hope this helps (a bit).

Cheers,
rash*
This topic is locked and no more replies can be posted.