Forums

Need to add and update/edit records

cmwincom 11 Feb, 2023
I'm using an advanced form, based on the demo Basic Article Listing, in CF v7, as suggested in a previous post.

I'm working with data in one table with just 7 columns. I have successfully created a table listing. There is a button to create new records, which opens a form to create a new record, save it, and refreshing the table list. No problem there.

I've created an edit link that should open the form with the data from the selected row. I should be able to edit the data, save it, and have the updated data appear in the table listing.

I have been able to get the form open with the data and edit it. When I save the data it doesn't actually update the record. Once I got the form working correctly for adding new records the form no longer opens a record with the data of a row selected for editing.

To troubleshoot, I created another version of the demo form. I tested it. It gives me a list of articles. I click the new article button and fill in the form. When I click save it does create a new record, but the the values entered in the fields is not saved. I click the edit link and it opens the form and those fields are blank because the data never saved. If I edit and save the data is not saved. I even opened an existing article, make some minor edits in the form, save, and the article isn't updated.

I need to resolve this so I can add new records and edit existing records. It would be nice if the demo form worked since documentation is lacking for CF v7, there's no tutorials or FAQ's available, and it's not possible to search this forum.
wbuk 12 Feb, 2023
If the form is submitting but no data is saved, then I suspect the issue is with the "Save Data" function.

Turn on debugging, then open and save the form. You should be able to see the data that has been submitted by the form, like this:



If you can see your data there, that means the data is successfully submitted by the form. Which means the problem lies with the "Save Data" function.

If you cannot see your data there, then that is because the data is not submitted by the form. Check your form to see why the data isn't being submitted.
TGeier 13 Feb, 2023
I assume that you used the value {data:YourModulName} in the "save Data - modul" under "Data set".

I currently have about 6 forms running. I access my own database tables to display or edit the relevant data.

I can help you, no problem🙂

Greetings from Germany.
cmwincom 14 Feb, 2023
I can save new records with no problem. The problem now is if I click the edit link for a record it opens the form, but the form is not populated with the data for the record. I can edit the fields and update the record. However, if any of the fields are left blank the record is updated with empty data. Using the debug I can see the data is being retrieved.

I've provide links to screenshot images below show the listing, the blank form for a selected record, and the debug data.

Once I get the form for editing a record to populate the form fields with the existing data then this should be performing exactly as I want it.


Image 1: https://518martialarts.com/images/chronoengine/Form00.png
Image 2: https://518martialarts.com/images/chronoengine/Form01.png
Image 3: https://518martialarts.com/images/chronoengine/Form02.png
TGeier 14 Feb, 2023
Unfortunately, no private messages go here.

Can you let me have a look in the backend? Maybe I can find the problem quicker than finding the error here with you.

My email: txxxxxxx@xxxx.de

I had problems at first too, but my 5 forms are working now. I retrieve data from the spreadsheet, change it, save it... just what you need.
cmwincom 15 Feb, 2023
Just sent you an email.
wbuk 15 Feb, 2023
So if I understand it right, you can read the data, but the fields in the edit page do not have the value of the data.

This seems to be because you didn't put the value data into the field. You can do it by doing the below:
cmwincom 16 Feb, 2023
Thanks to TGeier we have this resolved. In the Save Data action we change the Data Set from Whole Form Data to {data:Member}. Along with a couple other changes we are now functioning as desired.
You need to login to be able to post a reply.