diff --git a/.liquibase/Data_alias/basic/2021.0.2/alter_CompetitionExpandReasonSize.xml b/.liquibase/Data_alias/basic/2021.0.2/alter_CompetitionExpandReasonSize.xml new file mode 100644 index 0000000000000000000000000000000000000000..cd190defb87046297e90f18ce845fe34221d9934 --- /dev/null +++ b/.liquibase/Data_alias/basic/2021.0.2/alter_CompetitionExpandReasonSize.xml @@ -0,0 +1,21 @@ +<?xml version="1.1" encoding="UTF-8" standalone="no"?> +<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> + <changeSet dbms="derby" author="b.ulrich" id="cdc5aecd-417f-4a7a-bdcd-2fb75bada432"> + <sql> + ALTER TABLE COMPETITION ADD COLUMN REASON_NEW CLOB; + UPDATE COMPETITION SET REASON_NEW = REASON; + ALTER TABLE COMPETITION DROP COLUMN REASON; + RENAME COLUMN COMPETITION.REASON_NEW TO REASON; + </sql> + </changeSet> + <changeSet author="b.ulrich" id="05aabb59-501f-4832-a8cd-c17d38ac78f4"> + <preConditions onFail="CONTINUE"> + <not> + <dbms type="derby" /> + </not> + </preConditions> + <modifyDataType tableName="COMPETITION" columnName="REASON" newDataType="NCLOB"/> + </changeSet> +</databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/basic/2021.0.2/changelog.xml b/.liquibase/Data_alias/basic/2021.0.2/changelog.xml index ec78d188e06212f8181d22efd3c4386ed8c3c827..f2415888a9cdd9880f5c430d0a3b9f1320ab0b19 100644 --- a/.liquibase/Data_alias/basic/2021.0.2/changelog.xml +++ b/.liquibase/Data_alias/basic/2021.0.2/changelog.xml @@ -1,5 +1,6 @@ <?xml version="1.1" encoding="UTF-8" standalone="no"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> -<include relativeToChangelogFile="true" file="Event/changelog.xml"/> + <include relativeToChangelogFile="true" file="Event/changelog.xml"/> + <include relativeToChangelogFile="true" file="alter_CompetitionExpandReasonSize.xml"/> </databaseChangeLog> \ No newline at end of file diff --git a/.liquibase/Data_alias/changelog.xml b/.liquibase/Data_alias/changelog.xml index 55e9b42b3435df4543d14257793db42b89307bc4..c46a164da2f3cc26f2336d2aba78a1d54067672e 100644 --- a/.liquibase/Data_alias/changelog.xml +++ b/.liquibase/Data_alias/changelog.xml @@ -22,6 +22,7 @@ <include relativeToChangelogFile="true" file="basic/2021.0.0/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.0.1/changelog.xml"/> <include relativeToChangelogFile="true" file="basic/2021.0.2/changelog.xml"/> + <!--enable this only when you definetly want to overwrite the existing data with demo records:--> <!--<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>--> </databaseChangeLog> \ No newline at end of file diff --git a/entity/Competition_entity/Competition_entity.aod b/entity/Competition_entity/Competition_entity.aod index 8e08714b5b06f1bad56c3ccc46180c98b2834bb9..7c7f311b945078d8803fe0682ce7979c6a7c3eae 100644 --- a/entity/Competition_entity/Competition_entity.aod +++ b/entity/Competition_entity/Competition_entity.aod @@ -27,9 +27,8 @@ <entityField> <name>REASON</name> <title>Reason</title> - <consumer>KeywordWonLost</consumer> - <selectionMode>SINGLE</selectionMode> - <displayValueProcess>%aditoprj%/entity/Competition_entity/entityfields/reason/displayValueProcess.js</displayValueProcess> + <dropDownProcess>%aditoprj%/entity/Competition_entity/entityfields/reason/dropDownProcess.js</dropDownProcess> + <selectionMode>MULTI</selectionMode> </entityField> <entityField> <name>COMPETITIONID</name> @@ -334,10 +333,6 @@ <name>CONTACT_ID.displayValue</name> <recordfield>ORGANISATION.NAME</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>REASON.displayValue</name> - <expression>%aditoprj%/entity/Competition_entity/recordcontainers/db/recordfieldmappings/reason.displayvalue/expression.js</expression> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>PHASE.displayValue</name> <expression>%aditoprj%/entity/Competition_entity/recordcontainers/db/recordfieldmappings/phase.displayvalue/expression.js</expression> diff --git a/entity/Competition_entity/entityfields/reason/displayValueProcess.js b/entity/Competition_entity/entityfields/reason/displayValueProcess.js deleted file mode 100644 index 4058d229ee949c4c9b93c9f8bc05dda8ea3d60bc..0000000000000000000000000000000000000000 --- a/entity/Competition_entity/entityfields/reason/displayValueProcess.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.result"); -import("system.vars"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -result.string(KeywordUtils.getViewValue($KeywordRegistry.salesprojectWonLost(), vars.get("$field.REASON"))); diff --git a/entity/Competition_entity/entityfields/reason/dropDownProcess.js b/entity/Competition_entity/entityfields/reason/dropDownProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..8e12cae7f3fa1cc744096ce53b70005aebe91ef0 --- /dev/null +++ b/entity/Competition_entity/entityfields/reason/dropDownProcess.js @@ -0,0 +1,14 @@ +import("KeywordRegistry_basic"); +import("Keyword_lib"); +import("Sql_lib"); +import("system.result"); + +var keyIds = newSelect("AB_KEYWORD_ENTRY.KEYID") + .from("AB_KEYWORD_ENTRY") + .where("AB_KEYWORD_ENTRY.CONTAINER", "SalesprojectWonLost") + .arrayColumn(); + +var res = keyIds.map(function (keyId) { + return [keyId, KeywordUtils.getViewValue($KeywordRegistry.salesprojectWonLost(), keyId)] +}); +result.object(res); \ No newline at end of file diff --git a/entity/Competition_entity/recordcontainers/db/recordfieldmappings/reason.displayvalue/expression.js b/entity/Competition_entity/recordcontainers/db/recordfieldmappings/reason.displayvalue/expression.js deleted file mode 100644 index bcd63431cb33c5f998e787ae57b30663efc9a37f..0000000000000000000000000000000000000000 --- a/entity/Competition_entity/recordcontainers/db/recordfieldmappings/reason.displayvalue/expression.js +++ /dev/null @@ -1,6 +0,0 @@ -import("system.result"); -import("Keyword_lib"); -import("KeywordRegistry_basic"); - -var sql = KeywordUtils.getResolvedTitleSqlPart($KeywordRegistry.salesprojectWonLost(), "COMPETITION.REASON"); -result.string(sql);