Skip to content
Snippets Groups Projects
Commit f668973f authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Revert: address: do not validate mandatory if fields are empty

parent e4335c90
No related branches found
No related tags found
No related merge requests found
Showing with 5 additions and 98 deletions
......@@ -50,7 +50,6 @@
<title>Country</title>
<consumer>Countries</consumer>
<mandatory v="true" />
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/country/mandatoryProcess.js</mandatoryProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/country/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/country/displayValueProcess.js</displayValueProcess>
</entityField>
......@@ -65,7 +64,6 @@
<entityField>
<name>CONTACT_ID</name>
<mandatory v="true" />
<mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/contact_id/mandatoryProcess.js</mandatoryProcess>
<valueProcess>%aditoprj%/entity/Address_entity/entityfields/contact_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
......
......@@ -2,14 +2,4 @@ import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], AddressEntityValidation.isMandatoryField()));
\ No newline at end of file
result.object(AddressEntityValidation.isMandatoryField());
\ No newline at end of file
......@@ -2,14 +2,4 @@ import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], AddressEntityValidation.isMandatoryField()));
\ No newline at end of file
result.object(AddressEntityValidation.isMandatoryField());
\ No newline at end of file
import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], true));
\ No newline at end of file
import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], true));
\ No newline at end of file
......@@ -2,14 +2,4 @@ import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], AddressEntityValidation.isMandatoryField()));
\ No newline at end of file
result.object(AddressEntityValidation.isMandatoryField());
\ No newline at end of file
......@@ -2,14 +2,4 @@ import("Entity_lib");
import("system.result");
import("AddressEntity_lib");
result.object(ProcessHandlingUtils.getMandatoryIgnoreAllEmpty([
"$field.ADDR_TYPE",
"$field.ADDRESS",
"$field.BUILDINGNO",
"$field.ZIP",
"$field.CITY",
"$field.COUNTRY",
"$field.STATE",
"$field.REGION",
"$field.ADDRIDENTIFIER"
], AddressEntityValidation.isMandatoryField()));
\ No newline at end of file
result.object(AddressEntityValidation.isMandatoryField());
\ No newline at end of file
import("system.logging");
import("system.vars");
import("system.db");
import("system.result");
......
......@@ -13,7 +13,6 @@
<name>Header</name>
<iconField>IMAGE</iconField>
<titleField>CONTACT_ID</titleField>
<subtitleField>CONTACT_ID</subtitleField>
<descriptionField>INFO</descriptionField>
<entityField>#ENTITY</entityField>
</cardViewTemplate>
......
import("system.logging");
import("system.result");
import("system.neon");
import("system.vars");
......@@ -48,26 +47,6 @@ ProcessHandlingUtils.initialParamToResult = function(pParamVarName)
}
ProcessHandlingUtils.getMandatoryIgnoreAllEmpty = function(pFields, pIsMandatory)
{
var allEmpty = true;
logging.log("-------------")
pFields.forEach(function(pField) {
logging.log(pField + " " + vars.getString(pField))
if (vars.getString(pField))
{
allEmpty = false;
}
});
logging.log(allEmpty)
logging.log(pIsMandatory)
logging.log(!allEmpty && pIsMandatory)
logging.log("-------------")
return !allEmpty && pIsMandatory;
}
/**
* Workaround for detecting field changes of fields not managed by record containers.
* Should be fixed in the future: Ticket 1030023
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment