I'm new to WIX and have been a database developer for many years. I've searched the index of examples but can't find the answer to this simplest problem. Please note I fully understand referential integrity and reference types.
How do you insert a record on the many side of a one to many relationship when you can't use ID as the main field? Or in fact in a one - to - one relationship on the foreign key side
So for example
- I have a multi-stage form. In the first stage the user fills out their name and contact details. This represents one dataset, lets call it "People"
- The user clicks "Next" and a record is inserted into the People collection. They are taken to another stage where they enter the cars that they own. The cars data collection has a reference type field which references the "fullname" field in the People table (simply because I can't link to I.D and don't know how else to set it up). But how do I insert a record into the cars collection and link it to the People collection to create a one to many relationship? I cannot simply grab the "FullName" value and insert it in to the reference type field in the cars dataset as there may be many "John Smiths" (for example).
So is the only way to grab the ID inserted in stage one in the People collection and manually insert it into the cars collection thereby creating my own foreign key mechanism? If so, how do I grab this ID in code after submit?
BTW I have already looked at the Wishlist example but in this case the ITEMS already exist - in my scenario the "People" record is newly created.
Many thanks
Rob
yep, that's where I started, I don't really see how it helps with my issue which is about data
https://www.wix.com/corvid/example/Multistage-Form