Custom form error - Failed to save data entry: could not execute statement

Hi all,

I am getting the following error Failed to save data entry: could not execute statement when I click on the save button for custom forms.

This is what I see in the console

Thanks

Hey @hernandezmachava,
May I ask you what is the version of the DHIS2 instance that you are using? And it might help if you share the Tomcat log (make sure not to include sensitive info)?

The “could not execute statement” doesn’t really explain the reason, but there are things you can try to see if the issue persists or not. First, I would say make sure your user has authorities to access the data you are including in the form (data elements, indicators…etc). Second, did you try to use the Browser Cache Cleaner app because it might help, and I’d also recommend to “clear application cache” and “reload apps” in the Data Administration app > Maintenance. Third, if all this doesn’t work, I’d try two things: one is to use the same data but by removing any complexity from the HTML code (just basic HTML) and the second is not using the data but keeping the HTML code the way it is, and then we’d know if there’s an issue in the HTML code of the form or the data being used.

I hope this helps! Thank you! Please let me know if you want detailed instructions in any of the previous steps. (:

Hi @Gassim,

I am using DHIS version 2.34.5. I have Admin privileges but I don have access to Tomcat Log.

I have tried the following things: clean the browser cache and clear the application cache, but the problem does continue. I didn’t understand the third and four steps about HTML and HTML code.

Thanks

1 Like

Okay, may I ask you to take a screenshot of the Network tab. Open the Network tab (F12 > Network tab) then try to save the form and then if you see a red text click on it and take screenshot! Thank you!
Something like this …