I have an interface that stores the data in a record type, which has several fields. Once the interface is submitted, I want it to be saved in the database using a write record. And I get the following error:
Unable to write to or delete from the source due to a data integrity violation.Error Details: Field 'Detalles_Trasladado' doesn't have a default value.
That Field is not in that interface, but it is in other interface of the process.
How should I write the new record in the record type?
Thanks in advance
Discussion posts and replies are publicly visible
Hello miguelm137538
Your Database structure is defined in such a way that it does not accept null value for that field. You need to update the column in your DB to accept null. That would resolve your issue.
I typically add a bunch of a!save() to the saveInto of the submit button to initialize a record. Then, all the data population is in one spot and easy to change in the long run.
As Konduru Chaitanya mentioned you either need to update the DB table structure to accept null values for that column or you need to set the value for that field in your Record Type prior to calling writeRecords.
You could try setting a default value for it in the database, explicitly including it in the write operation, or making the field nullable if it's not always needed. Checking field mappings might also help. Hope this gets resolved! My younger sister was struggling with her college essays and I started searching and we found CanadianWritings essay writing https://canadianwritings.com/ for give a try. Their essay writing service was a huge help! The writers followed Canadian academic standards, and the quality was excellent. If you’re a student in Canada looking for professional writing assistance, this is a great service to try!