0

In SexyContent, I have a data type "Parent" with an "Entity" type data field called "Child". When I am in the edit form for "Parent", I can add or remove values for "Child" that are linked to Parent.

Now, I'd like to add a button in a view that lets a user directly add a "Child" record linked to the "Parent" record being shown in the view... is that possible?

The use case is having users sign up for events. The events are the parent records and the signups would be the child records. I know I could unlink the parents and children, then have the child records have the parent entity ID as one of their fields, and then set the parent entity ID to a disabled field when the user goes to register. But, I thought I'd see if this is possible.

Thanks.

Mike
  • 107
  • 7

1 Answers1

0

Basically you have parent events, and your registrations should be mapped to this, right?

There are two ways you can do this, and I believe you should think this through first

  1. the parent could have a list of registrations
  2. the registrations could refer to an event

Both data models work, but I believe you would prefer to use #2, meaning that you would have register-items with an entity pointing to the event.

You could then create a "register" form which prefils the parent-id using http://2sxc.org/en/Docs-Manuals/Prefill-new-Forms or your own api.

iJungleBoy
  • 5,325
  • 1
  • 9
  • 21