Hello, I'm trying to use ChronoForms V8. I've set up a test form that reads a record from the aaa_test_cf table, which contains the fields id - campo1 - campo2 - campo3. I have 4 textareas with the same names as the fields that take values from the first record of the table. On submit, I added the save data action, and in Behaviors, I added:
modify data source
id={data:id}
campo1={data:campo1}
campo2={data:campo2}
campo3={data:campo3}
Primary key
id
Table fields
campo1 campo2 campo3
When I save the record, I get the error "Duplicate entry '11' for key 'aaa_test_cf.PRIMARY'". If I remove id={data:id}, it saves a new record with a sequential id instead.
How can I force an update of the record?
modify data source
id={data:id}
campo1={data:campo1}
campo2={data:campo2}
campo3={data:campo3}
Primary key
id
Table fields
campo1 campo2 campo3
When I save the record, I get the error "Duplicate entry '11' for key 'aaa_test_cf.PRIMARY'". If I remove id={data:id}, it saves a new record with a sequential id instead.
How can I force an update of the record?
Add a WHERE statement to do an UPDATE:
id={data.quote:id}
Thank you, Max, it works perfectly.
I want to report an issue I've encountered with data loading. As you can see in the screenshots, when I load the "id" field, the system correctly reads the value (1), but in the text field, regardless of the read value, it writes "11". I tried changing the name in the table from "id" to "idx" (obviously resetting all the form references), and everything works correctly. I don't know if this is a bug or if I'm missing something.
I want to report an issue I've encountered with data loading. As you can see in the screenshots, when I load the "id" field, the system correctly reads the value (1), but in the text field, regardless of the read value, it writes "11". I tried changing the name in the table from "id" to "idx" (obviously resetting all the form references), and everything works correctly. I don't know if this is a bug or if I'm missing something.

id is the name of the id column in the forms table too, so I think there is a conflict
Did you know that you can use the "Merge data" behavior in the "Read data" to set your field values and avoid having to use the "Default value" for every field ?
Did you know that you can use the "Merge data" behavior in the "Read data" to set your field values and avoid having to use the "Default value" for every field ?
"Merge data" is perfect! works great to me.
You are right about the form id, 11 was the id of the form and if I duplicate it it takes the new id, so I do not have to use "id" in the tables.
Thanks Max.
You are right about the form id, 11 was the id of the form and if I duplicate it it takes the new id, so I do not have to use "id" in the tables.
Thanks Max.
You are welcome
You need to login to be able to post a reply.