Hi Andrew,
Because association is between objects, you cannot give individual attributes in an object different associations.
I would normalize the domain model and create an intermediate entity called TrunkTire. It should have an index attribute and associate with tire.
Normalizing this database you only need entities Truck and Tire and 18 references from Truck to Tire. This is a result of what you normaly do: Add the nouns of your specs in your domainmodel.
Then generate forms to get the _Overview and _NewEdit-pages. Created the tires, and then in the Truck_NewEdit you can select a specific tire for any of the 18 tire-places available on a truck:
There you go. Each reference selector will only affect it's own tire. You still have the problem that each specific tire (Autonumber) should only be allowed having one existing reference of the available 18, since in real life it can only be in one place at the time. Best make a BeforeCommit preventing multiple existing references. But also prevent tires that have an existing reference from showing up in the reference's dropdown by limiting the 'Selectable objects'.
Maybe doing this by micrflow would be better. Or adding a Tire-attribute boolean ‘IsMountedOnATruckSomewhere’ if performance becomes an issue.
In this model each Truck has a fixed (maximum) number of tires. If there is a need to vary the number of tires, you can add attribute NumberOfTires to entity Truck and implement BCo-logic to prevent more than NumberOfTires Tires getting added to a Truck. Don't forget spare-tires if there are any.
Hey Andrew,
Since everyone is posting pictures, so will I. I hope this helps.
I used your sentence where I see 3 entities and where you state that each truck has 18 tire indexes and each index a specific tire. (See picture)
This sounds like you need a Reference Set selector Truck can have multiple TireIndex objects and TireIndex object multiple trucks. However each TireIndex has a specific Tire.
This should slove your problem. At least make sure you got 18 objects in the TireIndex entity and your specific tires are linked to that index.
Good luck, let me know how it went!