Hello,
My app has a series of reference data stored in a separate table/RT. We've permitted the user to manage that data as the values (slowly) change over time. Part of that management is to disable selections for future use by making them inactive (isActive = False).
Dropdowns are used to access the reference data for creation and editing records. Only the active values are made available in the choiceValues/Labels to prevent use of outdated information.
The problem is in dealing with "historical" data. There are active records created the week previous that include a reference value that was made inactive=True this week. Now anytime these types of records get edited, the reference to the retired data causes an error because selected value is not on the current list of choiceValues. I could lift the isActive = true filter on edit vs. create new record, but some of the reference values are years old and not appropriate for selection vs a value that was retired just last week.
The question: What is the best practice for managing the availability of reference codes while enabling the editing of "historical" data?
Thank you for your consideration and thoughts,
Spencer Blanton
Discussion posts and replies are publicly visible
This is two questions in one.
The first one, how does business want to deal with this? Do the availability of these values depend on the current date, or on the creation date of the case?
The other question, the technical one, is simple. In the value parameter, add a check whether the value is in the list of choices. Make it NULL in the negative case.
I wanted to have a course of action to recommend before approaching the client because we built this design across the app and changing it will require touching almost a thousand interfaces across the suite.
Disabling the ability to select a value is not date dependent.
I can envision the how to logic to see if the selected values match the available choice values (assuming whereContains), but I don't understand the "make it null" portion of your response. The values in the data are already set. If I make the choiceValues null, it will still error out because of the mismatch between the choice value and actual data in the record. Did you mean to set the ApplyWhen on the queryfilter to false if there is a mismatch?
Making a value NULL is not my preferred approach when it's dealing with important data that must be updated.
When the possibility exists of a deactivated item showing up in a dropdown (i.e. a former selection that was valid at the time, but is no longer valid), I use a local variable to detect whether the item's default value is outside the list of allowed values. Then I append that value to the valid values seen in the dropdown, but I append a "tag" to the Display Value of that item indicating that it's no longer available. If necessary, a validation message can be added to the dropdown that requires the user to select a current/valid value as well (though in some cases this might not be desired, as sometimes you only want to prevent new entries from using deprecated data, but legacy entries could keep it). This works pretty well over-all despite the extra bending-over-backwards needed to set it up. cc spencerb0001