Create form that gets input of two table records and save

How to create a form that can hold input data for two entity tables having one to many relationships?

So from above diagram, Iam trying to create an agent who can have two contact details like working and permanent address(I will differentiate the it based on address type column in contact Dtls table). I am not able to create the same in single form.


Hello Ajithkumar.

What you want to do is possible, but it is not "easy", as you would have to add twice the Contact and the Connection entities to the aggregate.

I would say that there is something wrong with your data model, or with your idea for the interface.
If you can ONLY apply for two contacts (permanent and work) than probably you would be better served not using a Many to Many relationship.

If for some reason you can add more contacts (maybe as many as the user wants), than you should use the most traditional Master-Detail approach, where you have a table bellow the form that shows the contacts and allows you to add/edit/delete contacts.