Forums

CC and CF : Pb to update a record

graaooor 21 Jul, 2016
Hello,

I have a CC list and a CF to edit each record.
All my fields are displayed, but when I submit the CF, a new record is created and not updated.
What is wrong ?

Regards
GreyHead 21 Jul, 2016
Hi graaooor,

You need to have a hidden input in the form to hold the record id of the record that you are editing. Then that will be available when the form submits and the old record will be updated. The hidden input should have the same name as the Primary Key of the table, usually cf_id or id.

Bob
graaooor 21 Jul, 2016
I have a hidden field name "id" in my form.
This is the same as the primary key of my table.
The debug is :
Array
(
    [cont] => lists
    [ccname] => connectBtest
    [act] => edit
    [gcb] => 1
    [SAV] => Array
        (
            [id] => 1
            [user_id] => 656
            [nom] => xxxxxxxxxx
            [description] => yyyyyyyyyyyyyyyy
        )
)

If I put "save" in "connection action", a new record is created.
Ij I put toggle, I have this message : "Update Failed".
This topic is locked and no more replies can be posted.