Forum Discussion
FICO
17 years agoCommunity Manager
Problem with database providers
Problem with database providers Hi, I have two database providers the key for the second is (in part) a value returned from the first. The value holders are optional entries. This is the se...
FICO
16 years agoCommunity Manager
Now I understand
I would probably solve this in one of two ways. First, provider implementations are capable of returning different values for different contexts, i.e. a separate value for the display (RMA/user) and the generated code (SRL content). A very simple solution is to select your (code, display) data as key, value pairs, and return the key as the content value and the value as the display value.
If you have a slightly more complex code table, e.g. separate numeric primary key, valid from/to dates, etc, you could solve this using two value holders. The first value holder would select identifier and the display value as the key, value pair. This is the provider you use to make the user select a value. The content value will now be the unique identifier corresponding to the selection the user made, and you use this as the argument in a dynamic override to the second, hidden provider that selects the content value based on the identifier.
The second provider should handle invalid input without failing, as you will have several situations where the input will be invalid. It should also extend the NdTemplateLogicalValueProvider (or something similar - can't remember the exact name right now). By implementing that interface you tell blaze that this is a derived value holder, and that the value should not be stored but computed when needed.
HTH,
Jostein