Skip to main content
January 21, 2025
Solved

Write Records

  • January 21, 2025
  • 4 replies
  • 0 views

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

Best answer by konduruc733182

Hello [mention:af6e79751f9d475298e02cce5b3732d0:e9ed411860ed4f2ba0265705b8793d05] 

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.

4 replies

konduruc733182
January 21, 2025

Hello [mention:af6e79751f9d475298e02cce5b3732d0:e9ed411860ed4f2ba0265705b8793d05] 

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.

stefanhelzle0001
January 21, 2025

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.

mathieud0001
January 21, 2025

As [mention:2df2892a4df7486f9775b4d2f0e405fd:e9ed411860ed4f2ba0265705b8793d05] 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.

February 14, 2025

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!