diff --git a/LDK/resources/scripts/ldk/Utils.js b/LDK/resources/scripts/ldk/Utils.js index e67bc056..00cd804f 100644 --- a/LDK/resources/scripts/ldk/Utils.js +++ b/LDK/resources/scripts/ldk/Utils.js @@ -73,6 +73,25 @@ LDK.Server.Utils = new function(){ //normalize to a javascript date object date = new Date(date.getTime()); return new Date(date.getFullYear(), date.getMonth(), date.getDate()); + }, + + /** + * Replaces each named field's value with the case-normalized value from its lookup target, adding an error for any value the target does not contain. + * The helper must be created at script scope: it caches each target's allowable values per instance, so creating one per call would re-read the target table for every row. + */ + normalizeLookupFields: function(helper, row, errors, lookupFields){ + for (var i=0;i