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.