Use the Value Cross Referencing (It’s a many-to-one mapping) instead of the ID Cross Referencing (It’s a one-to-one mapping). You also get a performance benefit due to Value Cross Referencing uses caching.
See Difference between Value & Id Cross references quoted below (with minor spelling corrections).
I spent some time to know the differences between “id” and “value” cross referencing and I was able to get the below points which I thought of worth sharing.
At a high level, these two concepts will look similar. But they operate with few differences.
Value Cross Referencing
These cannot me modified during run-time.
This occurs between app types.
This cross-referencing is commonly between enumeration fields.
This uses caching mechanism. After any changes in database, we have to restart the corresponding host instances to see the changes.
It’s a many-to-one mapping.
The mapping is guaranteed in only one direction.
When you want to use them for the reverse mapping for a value which is mapped to multiple inputs, the first value stored in the xref tables is fetched.
The below mapping is allowed. So in this case , the reverse mapping may not give the expected output.
Apple – Fruit
Banana – Fruit
Grape – Fruit
We have to use the GetCommonValue & GetApplicationValue functoids in the maps
Id Cross Referencing
These may be set at run-time. Set Common ID functoid is used for this.
This occurs between appinstance types.
This cross-referencing is commonly between entity unique identifiers.
In this, we will hit the database for every call.
It’s a one-to-one mapping.
The mapping is guaranteed in both directions.
Reverse mapping is always in synch with the initial mapping.
The above mapping is not allowed allowed and are restricted by constraints on the Id cross reference tables.
Apple – Fruit
Banana – Fruit
Grape – Fruit
We have to use the GetCommonId & GetApplicationId functoids in the maps