I've been working on replicating the functionality of Orders-Order detail in my own project.
https://i.stack.imgur.com/Bt47B.png
My custom module is called Contract and Contract Line item, which I'm using to achieve this.
https://i.stack.imgur.com/rn04m.png
https://i.stack.imgur.com/MW0YC.png
The issue arises when adding a contract line item from the contract dialog - upon saving, the Contract Id (foreign key) ends up null, instead of being automatically filled from the parent table Contract.
https://i.stack.imgur.com/l9PVa.png
If you have any ideas or suggestions, I would greatly appreciate it. Thank you.