diff --git a/build.properties.d/00_default.properties b/build.properties.d/00_default.properties
index 99a031cef8e9d9f55a723d8ad325bff710b1217d..96017406e54c3275ed9b5884f7292ca8611e6142 100644
--- a/build.properties.d/00_default.properties
+++ b/build.properties.d/00_default.properties
@@ -151,6 +151,12 @@ BUILD_FOOTER_CUSTOM_ELEMENT_TWO='<p class="caosdb-footer-element"> <a href="http
 ##############################################################################
 BUILD_MODULE_EXT_TRIGGER_CRAWLER_FORM_TOOLBOX="Tools"
 
+##############################################################################
+# Reduce the number of candidates for references in the edit mode to this
+# value. -1 means: no limit.
+##############################################################################
+BUILD_MAX_EDIT_MODE_DROPDOWN_OPTIONS=-1
+
 ##############################################################################
 # Build a dist file containing all JS code from the files in the
 # MODULE_DEPENDENCIES array.
diff --git a/src/core/js/edit_mode.js b/src/core/js/edit_mode.js
index 641cd1b6ec2155089ab523ef2802e241985467d5..afb3da9289b163cacc5b957ead181879cbcb58c1 100644
--- a/src/core/js/edit_mode.js
+++ b/src/core/js/edit_mode.js
@@ -1892,9 +1892,11 @@ var edit_mode = new function () {
      */
     this.retrieve_datatype_list = async function (datatype) {
         var find_entity = ["FILE", "REFERENCE"].includes(datatype) ? "" : `"${datatype}"`;
-        const max_options = 100; //for each query; there might be more candidates in total
-        var n_entities = datatype !== "FILE" ? await edit_mode.query(`COUNT Record ${find_entity}`, true) : 0;
-        var n_files = await edit_mode.query(`COUNT File ${find_entity}`, true);
+        const max_options = parseInt("${BUILD_MAX_EDIT_MODE_DROPDOWN_OPTIONS}"); //for each query; there might be more candidates in total
+        if (max_options != -1){
+            var n_entities = datatype !== "FILE" ? await edit_mode.query(`COUNT Record ${find_entity}`, true) : 0;
+            var n_files = await edit_mode.query(`COUNT File ${find_entity}`, true);
+        }
         var entities = datatype !== "FILE" ? edit_mode.query(`FIND Record ${find_entity}&P=0L${max_options}`, true) : [];
         var files = edit_mode.query(`FIND File ${find_entity}&P=0L${max_options}`, true);
 
@@ -1905,7 +1907,7 @@ var edit_mode = new function () {
             .concat(edit_mode
                 ._create_reference_options(await files));
 
-        if (n_entities > max_options || n_files > max_options) {
+        if (max_options !=- 1 && (n_entities > max_options || n_files > max_options)) {
             // add notification that not all entities are shown
             options = [$(`<option disabled=true value="NA"/>`).text(
                 `More than ${max_options} possible options; showing only a subset. You may need to enter the id manually.`