I tried out a new version of Hubleto and wanted to use some of it's forms. But I later found out the data in tables inside forms is not saving.
I decided to dig around and found out the relation data (an array of objects) in the Form.tsx in the saveRecord()
method is deleting itself when it's being transferred into the record
variable.
The data looks similar to this:
{
id: 1,
PRODUCTS: [
{id: 1},
{id: 2}
]
}
It happens at this line specifically:
let record = { ...this.state.record, id: this.state.id };
Any idea of why it's happening?
I tried out a new version of Hubleto and wanted to use some of it's forms. But I later found out the data in tables inside forms is not saving.
I decided to dig around and found out the relation data (an array of objects) in the Form.tsx in the saveRecord()
method is deleting itself when it's being transferred into the record
variable.
The data looks similar to this:
{
id: 1,
PRODUCTS: [
{id: 1},
{id: 2}
]
}
It happens at this line specifically:
let record = { ...this.state.record, id: this.state.id };
Any idea of why it's happening?
Share Improve this question edited Feb 13 at 7:03 Rindo789 asked Feb 3 at 13:28 Rindo789Rindo789 214 bronze badges 3 |1 Answer
Reset to default 0Most probably your form description did not contain includeRelations
property. Check the Description API: https://developer.hubleto/advanced-development/description-api/form
this.state
contain before this line of code? What doesrecord
contain after this line of code? What different result were you expecting it to contain and why? – David Commented Feb 3 at 13:46