diff --git a/apps/maarch_entreprise/indexing_searching/search_adv_result.php b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
index c6bb705d4bb7ee2893071b4e966bdecfab6d51ad..bdd6d03ad701ee19cca5f1e3352a343308c58c14 100755
--- a/apps/maarch_entreprise/indexing_searching/search_adv_result.php
+++ b/apps/maarch_entreprise/indexing_searching/search_adv_result.php
@@ -787,7 +787,7 @@ where lower(translate(folders.label , 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ
                         }
                     }
                 }
-            } elseif (preg_match('/^indexingCustomField_/', $tab_id_fields[$j])) {  // opt indexes check
+            } elseif (preg_match('/^indexingCustomField_/', $tab_id_fields[$j]) && !empty($_REQUEST[$tab_id_fields[$j]])) {  // opt indexes check
                 $customFieldId = str_replace("indexingCustomField_", "", $tab_id_fields[$j]);
                 $customFieldId = str_replace("_min", "", $customFieldId);
                 $customFieldId = str_replace("_max", "", $customFieldId);
@@ -800,21 +800,22 @@ where lower(translate(folders.label , 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓ
                     $arrayPDO       = array_merge($arrayPDO, array(":customFieldId_".$customFieldId => $customFieldId, ":valueCustom_".$customFieldId => '"'.$_REQUEST[$tab_id_fields[$j]].'"'));
                 } elseif ($customField['type'] == 'date') {
                     if (strpos($tab_id_fields[$j], '_from') !== false) {
-                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId." and (value::text::timestamp) > (:valueCustom_".$customFieldId."::timestamp))) and ";
+                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId."_".$j." and (value::text::timestamp) >= (:valueCustom_".$customFieldId."_".$j."::timestamp))) and ";
+                        $arrayPDO = array_merge($arrayPDO, array(":customFieldId_".$customFieldId."_".$j => $customFieldId, ":valueCustom_".$customFieldId."_".$j => '"'.$_REQUEST[$tab_id_fields[$j]].'"'));
                     } elseif (strpos($tab_id_fields[$j], '_to') !== false) {
-                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId." and (value::text::timestamp) < (:valueCustom_".$customFieldId."::timestamp))) and ";
+                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId."_".$j." and (value::text::timestamp) <= (:valueCustom_".$customFieldId."_".$j."::timestamp))) and ";
+                        $arrayPDO = array_merge($arrayPDO, array(":customFieldId_".$customFieldId."_".$j => $customFieldId, ":valueCustom_".$customFieldId."_".$j => '"'.$_REQUEST[$tab_id_fields[$j]].' 23:59:59"'));
                     }
-                    $arrayPDO = array_merge($arrayPDO, array(":customFieldId_".$customFieldId => $customFieldId, ":valueCustom_".$customFieldId => '"'.$_REQUEST[$tab_id_fields[$j]].'"'));
                 } elseif ($customField['type'] == 'string') {
                     $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId." and (value::text) ilike (:valueCustom_".$customFieldId."))) and ";
                     $arrayPDO       = array_merge($arrayPDO, array(":customFieldId_".$customFieldId => $customFieldId, ":valueCustom_".$customFieldId => '%'.$_REQUEST[$tab_id_fields[$j]].'%'));
                 } elseif ($customField['type'] == 'integer') {
                     if (strpos($tab_id_fields[$j], '_min') !== false) {
-                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId." and value > :valueCustom_".$customFieldId.")) and ";
+                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId."_".$j." and value >= :valueCustom_".$customFieldId."_".$j.")) and ";
                     } elseif (strpos($tab_id_fields[$j], '_max') !== false) {
-                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId." and value < :valueCustom_".$customFieldId.")) and ";
+                        $where_request .= " (res_id in (select res_id from resources_custom_fields where custom_field_id = :customFieldId_".$customFieldId."_".$j." and value <= :valueCustom_".$customFieldId."_".$j.")) and ";
                     }
-                    $arrayPDO = array_merge($arrayPDO, array(":customFieldId_".$customFieldId => $customFieldId, ":valueCustom_".$customFieldId => '"'.$_REQUEST[$tab_id_fields[$j]].'"'));
+                    $arrayPDO = array_merge($arrayPDO, array(":customFieldId_".$customFieldId."_".$j => $customFieldId, ":valueCustom_".$customFieldId."_".$j => '"'.$_REQUEST[$tab_id_fields[$j]].'"'));
                 }
             }
         }
diff --git a/modules/sendmail/Controllers/MessageExchangeReviewController.php b/modules/sendmail/Controllers/MessageExchangeReviewController.php
index d3c1f762993394532513698c20b1b492b91a273d..759a85e766afb4fb5c7ac62c229bb2b6945d5756 100755
--- a/modules/sendmail/Controllers/MessageExchangeReviewController.php
+++ b/modules/sendmail/Controllers/MessageExchangeReviewController.php
@@ -35,7 +35,7 @@ class MessageExchangeReviewController
         }
 
         $resLetterboxData = ResModel::getOnView([
-            'select'  => ['entity_label', 'res_id', 'identifier', 'external_id'],
+            'select'  => ['entity_label', 'res_id', 'external_id'],
             'where'   => ['res_id = ?'],
             'data'    => [$aArgs['res_id']],
             'orderBy' => ['res_id'], ]);
diff --git a/src/app/external/messageExchange/controllers/MessageExchangeReviewController.php b/src/app/external/messageExchange/controllers/MessageExchangeReviewController.php
index 0a5ba2e834b79c13fe4a6a3935cf19d3a463571e..9e5fcfe2174e75285c952762f7fb58411f2f1868 100755
--- a/src/app/external/messageExchange/controllers/MessageExchangeReviewController.php
+++ b/src/app/external/messageExchange/controllers/MessageExchangeReviewController.php
@@ -30,7 +30,7 @@ class MessageExchangeReviewController
         }
 
         $resLetterboxData = ResModel::getOnView([
-            'select'  => ['entity_label', 'res_id', 'identifier', 'external_id'],
+            'select'  => ['entity_label', 'res_id', 'external_id'],
             'where'   => ['res_id = ?'],
             'data'    => [$aArgs['res_id']],
             'orderBy' => ['res_id'], ]);