diff --git a/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod b/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod index f7f1ea99ec92ee8eb0262b45f087fe1140b5ab22..edce71162116b3faaa55a8a53724aab0c7783bca 100644 --- a/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod +++ b/entity/EmailFilterHandling_entity/EmailFilterHandling_entity.aod @@ -26,6 +26,7 @@ <title>Filter</title> <contentType>FILTER_TREE</contentType> <valueProcess>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filter/valueProcess.js</valueProcess> + <onValidation>%aditoprj%/entity/EmailFilterHandling_entity/entityfields/filter/onValidation.js</onValidation> </entityField> <entityField> <name>EMAIL_FILTER_HANDLINGID</name> diff --git a/entity/EmailFilterHandling_entity/entityfields/filter/onValidation.js b/entity/EmailFilterHandling_entity/entityfields/filter/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..d047d71f7b916d6f1403ec2fa887a428fe7154ef --- /dev/null +++ b/entity/EmailFilterHandling_entity/entityfields/filter/onValidation.js @@ -0,0 +1,15 @@ +import("KeywordRegistry_basic"); +import("system.vars"); +import("system.translate"); +import("system.result"); +import("JditoFilter_lib"); + +if (vars.get("$local.value")) +{ + var filter = new FilterConditionGroup(JSON.parse(vars.get("$local.value"))); + + if(filter.isEmpty()) + { + result.string(translate.text("Filter can't be empty")); + } +}