Im looking for help to prevent duplicate entries of vehicle Year/Make/Model/Trim etc.
I have a drop down list that displays dynamic choices of year/make/model for various vehicles.
When an option doesnt exist, the user will need to enter the new vehicle year/make model to add to the data base for future use.
I have seperate databases for years - makes - models. I have 3 other trim levels as well but i assume the process will be the same for this use case.
My current model is one I found online from SOF …
Year = Year title
Make = Make title / year unique_id
Model = Model title / make unique_id
Trim = Trim Title / model unique_id
My problem is how do i format the submition to thee database, so that when I assign a product to the specific Model,/trim, I can search for that specific yr/mk/mdl/trm and retrieve the associated products.
I obviously cant have (2) 2020/ford/mustang/convertible entries with the associated products linking to only one of the vehicle entries.
im trying to add a vehicle to the database ( with noted variables) ONLY if it doesnt exist already, so that i can link associated products to said vehicle via unique_id.
Ive played with a few Only When conditionals but im having a hard time figuring out how to make ONE submission add only the variables needed.
I.E - i have a 2020 Ford Escape in the DB, but i need to add a 2020 Ford Mustang, but not add duplicate entries to my drop downs for “2020” and “Ford” but still retain a link back to said Yr/Make