I have two two tables: vehicles and service_centers. I want to be able to select a vehicle AND select a service_and and then insert a new record in the appointments table which references the vehicle and the service_center.
I can create a layout to "find" a vehicle, but I don't know how to add a list of service_centers to that layout. Can I create a portal for service_centers, even though there is no linkage between vehicles and service_centers. Help!
Once I select the vehicle and the service_center. how do I insert their keys into the appointments table? I'm thiking that I should be able to copy the keys into (global?) variables, and then copy the variable value into the newly inserted appointment record, but I can't find a script command that inserts a varialble into a record's field.
You probably want to do this in the appointments table using value lists attached to the foreign key fields for service centres and vehicles.
Check the help documentation for creating value lists. You'll want a list that carries the ID and uses a Text field to provide naming/labelling.
In this scenario, you simply create a new appointment record. You then select the field for a vehicle or service centre and the list will drop-down or pop-up or it could be a radio button selection if the choices are limited.
You may find the sttached file useful. It is an old demo that I put together to demonstrat the many to many relationship. It is pre variable and I haven't reviewed it to bring it up to the latest tectniques.
ManyToMany.fp7.zip 16.9 K