I'm trying to find all vehicles that have a string of accessories.
I have a comma sep string of optioncodes that represent selectedItems from an options List
optionsString:String = leather,stripes, ...
I have an ArrayCollection called vehicleOptions that contains a list of vehicle options one row per option
VIN1,optioncode
VIN1,optioncode
VIN2,optioncode
VIN2,optioncode
VIN3,optioncode
...
I need to retrieve all vehicles (VINs) that have, not one, but ALL of the optioncodes contained in the selected optioncodes string.
Any recommendations on how to do this?
Once I have a list of VINs, this will allow me to filter down another List of vehicles on the lot by only the vehicles that have ALL the selected options.
Thanks!
Don
Thanks Alex.
indexOf should be fine for checking if one option exists. I was just struggling with how to track/store only vehicles that have ALL the items in the option string, not just one.
I'm thinking a VIN array to store only the VINs that have all the options. And basically removing the VIN if one of them is not found. If all of the options are found, keep it. Not sure if that will work. I'm planned to try this today.
Don
North America
Europe, Middle East and Africa
Asia Pacific