diff --git a/entity/ImportField_Entity/recordcontainers/db/conditionProcess.js b/entity/ImportField_Entity/recordcontainers/db/conditionProcess.js
index 91a535f5087487e376823e6efc03fb8f82553e57..869f9d26a12eda41c0be010b1f787ecbe4550803 100644
--- a/entity/ImportField_Entity/recordcontainers/db/conditionProcess.js
+++ b/entity/ImportField_Entity/recordcontainers/db/conditionProcess.js
@@ -1,7 +1,4 @@
-import("system.vars");
-import("system.db");
 import("system.result");
 import("Sql_lib");
-var cond = new SqlCondition();
-cond.andPrepareVars("IMPORTFIELD.LEADIMPORT_ID", "$param.LeadImportID");
-result.string(db.translateCondition(cond.build("1 = 1")));
\ No newline at end of file
+
+result.string(newWhere("IMPORTFIELD.LEADIMPORT_ID", "$param.LeadImportID").toString());
\ No newline at end of file
diff --git a/entity/LeadLog_entity/recordcontainers/db/conditionProcess.js b/entity/LeadLog_entity/recordcontainers/db/conditionProcess.js
index 5eb5fee1d896e87d148863343a81ad875b493f9c..f5bdf487c8adf97c01c13c7723c87a8bd1108fb8 100644
--- a/entity/LeadLog_entity/recordcontainers/db/conditionProcess.js
+++ b/entity/LeadLog_entity/recordcontainers/db/conditionProcess.js
@@ -1,7 +1,4 @@
-import("system.vars");
-import("system.db");
 import("system.result");
 import("Sql_lib");
-var cond = new SqlCondition();
-cond.andPrepareVars("LEADLOG.LEADIMPORT_ID", "$param.LeadImportId");
-result.string(db.translateCondition(cond.build("1 = 1")));
\ No newline at end of file
+
+result.string(newWhere("LEADLOG.LEADIMPORT_ID", "$param.LeadImportId").toString());
\ No newline at end of file
diff --git a/entity/LeadTemp_entity/recordcontainers/db/conditionProcess.js b/entity/LeadTemp_entity/recordcontainers/db/conditionProcess.js
index 6c4d4fff78ebfe2a3baaede0099bfad95c98b131..cab716e8ddd53b060d345b63d7a92fafae130939 100644
--- a/entity/LeadTemp_entity/recordcontainers/db/conditionProcess.js
+++ b/entity/LeadTemp_entity/recordcontainers/db/conditionProcess.js
@@ -1,7 +1,4 @@
-import("system.vars");
-import("system.db");
 import("system.result");
 import("Sql_lib");
-var cond = new SqlCondition();
-cond.andPrepareVars("LEADTEMP.ROW_ID", "$param.LeadImportId");
-result.string(db.translateCondition(cond.build("1 = 1")));
\ No newline at end of file
+
+result.string(newWhere("LEADTEMP.ROW_ID", "$param.LeadImportId").toString());
\ No newline at end of file
diff --git a/entity/Lead_entity/recordcontainers/db/conditionProcess.js b/entity/Lead_entity/recordcontainers/db/conditionProcess.js
index 728c5aa134a854c275f5eff0c731c079b1c396ad..fe9e31415a33cc2ab1916661060c308870f2dc52 100644
--- a/entity/Lead_entity/recordcontainers/db/conditionProcess.js
+++ b/entity/Lead_entity/recordcontainers/db/conditionProcess.js
@@ -1,7 +1,4 @@
-import("system.vars");
-import("system.db");
 import("system.result");
 import("Sql_lib");
-var cond = new SqlCondition();
-cond.andPrepareVars("LEAD.LEADIMPORT_ID", "$param.LeadImportId");
-result.string(db.translateCondition(cond.build("1 = 1")));
\ No newline at end of file
+
+result.string(newWhere("LEAD.LEADIMPORT_ID", "$param.LeadImportId").toString());
\ No newline at end of file
diff --git a/process/AttributeFilter_lib/process.js b/process/AttributeFilter_lib/process.js
index 2427bdf5db6358b83b62ce804be783b9455c53f3..8bf6eff6f9baa779362eab5ead8bcd1f0e35df3a 100644
--- a/process/AttributeFilter_lib/process.js
+++ b/process/AttributeFilter_lib/process.js
@@ -127,7 +127,7 @@ AttributeFilterExtensionMaker.getFilterCondition = function(pObjectType, pFilter
 
         var condition = pCondition;
         if (attributeType == $AttributeTypes.BOOLEAN.toString())
-            condition = newWhere(["AB_ATTRIBUTERELATION", dbField], pRawValue, pOperatorName == "LIKE" ? SqlBuilder.EQUAL() : SqlBuilder.NOT_EQUAL());
+            condition = newWhere(["AB_ATTRIBUTERELATION", dbField], SqlUtils.escapeVars(pRawValue), pOperatorName == "LIKE" ? SqlBuilder.EQUAL() : SqlBuilder.NOT_EQUAL());
         else
         {
             condition = pCondition;