New modules master detail relationship

Hi everyone,
Can someone guide me on how to create master detail relationship in custom modules?
For example, we have 3 tables users, events and event_detail, I need a new table that relate user+event+event_detail-checkin and event_detail_checkout.
user->event is N to N
event->event_detail is 1 to N
user->event_detail is 1 to 1

Thanks

Go to Admin, Module Builder, create a new module, then relationships in the very way you described: relate event to user N to N, relate to evant_detail 1 to N and then relate event_detail to user 1 to 1.

Publish and load via module loader.

Hi @mtierno,
the event_detail doesn’t have the relation event+user, when I create a new event and add a user it must fill event_detail with this event+user and is not… them I will only edit event_detail_checkin/out.
In the form event_detail I can select one event and one user but I don’t want to create the relation manually.

Regards

Use a workflow. Whenever you create an event with a user added to it, the work flow creates a new event_detail and relate it to the event and the user.