I have a simple form for inserting some data. I have a date field where I am getting an error during the insert. I can't seem to figure out why because when I preview the query result and if I hover over the query field parameters it displays the proper date format with the data. I'm using unicode format yyyy-MM-dd. The update works just fine also using the same form with the same field. It just insert that has an issue and it's not clear to me why.
The date is not null that I am inserting. Update works, insert does not. I manually inserted through pgadmin to see and it works just fine. Any ideas or recommendations?
After the error pops up, right click on the query and select "View in State". You should see a bunch of data, and there should be one with the body of the request, would you mind pasting that there (removing any sensitive data)?
The error seem pretty clear that it is getting an empty value on insert and that is not the case. I am selecting the date and format is the same for the table which I performed the exact same insert SQL statement as the app within pgadmin and it works just fine. Is it something with the date component? I even replaced the component in case there was some sort of bug with it.
I figured out the issue. It was a combination of a few things. I had recreated the form so I needed to update the key values for insert. The other issue was I had a mapped value on the date field within the table that needed to be removed. It's all good now.
On my other app it is the exact scenario where I have a date field but this time I may not need to select a date. I am getting the same message. What is the best approach when inserting data and you have a date field that is null because you don't need to set it for that insert?
Cool. Now one other thing. What do I need to do to fix this for inline edits? My query for inline edits I use "Bulk update via primary key" and use this array {{ table1.changesetArray }}. How do I need to modify this for my date fields where it could be empty for insert?