Making relations with different tables based on data from another table
so, here's the problem:
in the model I'm trying to build there is a relation which I think is kind of complicated. Movement, has a relation to Location via the idUbicacionConsumo OR the idUbicacionEntrega fields....
the condition which establishes with which field is the former relation created, is %KEY_product_type => if it is 1 or 3, the relation is to be created with idUbicacionConsumo (in the Movement table) and %KEY_location (in the Location table)
the relation is to be created with idUbicacionEntrega (in the Movement table) and %KEY_location (in the Location table)
thank you for any time you can spare in this issue!