Entity Relatedq

0
I have to two entity first is employee and second is leave entity.there is common attribute empid in both entity.now i want to when i enter all data in employee entity in page and save the data. after in leave entity i want to automatically fatch that empid which already in the employee entity. i set empid type is auto number in the employee entity. how to create this type page.
asked
1 answers
0

It sounds like you are trying to link 2 entities by storing a foreign key in the Leave entity. While this is possible (you can use an Xpath query to display the 'linked' entries), this is not the recommended method.

The recommended way is to create an association between the 2 entities. In your database this creates a 3rd table which contains the 2 foreign keys to the linked objects, and records are automatically created and maintained/deleted in this table when you link entries through reference selector (or reference set selector) widgets.

In your case you should create an association from the Leave entity to the Employee entity, so that each Leave entity is linked to an employee.

answered