Page 1 of 1

parent/children register

Posted: 2015-09-06 01:30
by tuxor
Hi, I have 2 tables with parent/children option enabled:

ventas (parent): id,fecha,vendedor,importe
detalle_venta (children): id,id_venta,codigo_producto,precio,cantidad,importe

When insert a new register in detalle_venta, don't show nothing in the table, and when check in the phpmyadmin, the id_venta is null. For example

ventas:
id=5
fecha= 2015-09-05 18:59:25
vendedor=2
importe=0

detalle_venta:
id=4
id_venta=null
codigo_producto=3
precio=null
cantidad=20

why this happens?

Another thing. I have the field codigo_producto like lookup field and precio like autofill, both from the another table. If I choose one item from the select list of the field codigo_producto, the field precio appears the content of the field from another table, but don't save the price.

I need to save the value of precio in the detalle_venta table too.
Can you tell me how to fix that?

Re: parent/children register

Posted: 2015-09-10 19:12
by a.gneady
When insert a new register in detalle_venta, don't show nothing in the table, and when check in the phpmyadmin, the id_venta is null.
Could you post the AXP project file or send it via a support request to check this issue please?
I have the field codigo_producto like lookup field and precio like autofill, both from the another table. If I choose one item from the select list of the field codigo_producto, the field precio appears the content of the field from another table, but don't save the price.
Lookup fields save only the primary key of the parent record rather than the actual value displayed to users. That's why you see the price displayed, but a seemingly unrelated number stored in the field -- that number is the primary key value.

Re: parent/children register

Posted: 2015-09-14 21:48
by tuxor
I sent you the axp project in a support request.

Thank you

Re: parent/children register

Posted: 2015-09-22 11:40
by a.gneady
I'm so sorry for the long delay. We needed some deep investigation of this issue. It turned out to be a bug that caused the lookup field to be left empty if it's a read-only field. We'll work on fixing this in the next release. A temporary fix for now is to uncheck the read-only option for the ID_VENTA field. Please accept my deep apologies for any inconvenience caused by this issue.