Skip to content
Snippets Groups Projects
Commit 31454c57 authored by Andre Loreth's avatar Andre Loreth
Browse files

Standard-Address: Fixed new contact

parent 6eea67b7
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,6 @@
<mandatory v="false" />
<displayValueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess>
<onValidation>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValidation.js</onValidation>
<onValueChange>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValueChange.js</onValueChange>
</entityField>
<entityField>
<name>PERSON_ID</name>
......@@ -92,6 +91,7 @@
<entityField>
<name>ADDRESS_ID</name>
<title>standard address</title>
<valueProcess>%aditoprj%/entity/Contact_entity/entityfields/address_id/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>PERSON_TITLE</name>
......
import("system.logging");
import("system.result");
import("system.vars");
import("StandardObject_lib");
// Check if the standard address is already set.
if (vars.get("$field.ADDRESS_ID") === null || vars.get("$field.ADDRESS_ID") === "" || vars.get("$field.ADDRESS_ID") == 0) {
var possibleStandardAddressID = new StandardObject("Address", null, "Person", vars.get("$field.CONTACTID"))
.onPersonValueChange(vars.get("$field.ORGANISATION_ID"));
// If a possible standard addrss was found it should get applied to the field.
if (possibleStandardAddressID !== null)
result.string(possibleStandardAddressID);
}
\ No newline at end of file
import("system.vars");
//since the standard address can be only values of org the standard address has to be reset on org change
vars.set("$field.ADDRESS_ID", "");
\ No newline at end of file
......@@ -481,6 +481,7 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
<title>Address</title>
<consumer>ContactAndOrganisationAddresses</consumer>
<searchable v="false" />
<valueProcess>%aditoprj%/entity/Person_entity/entityfields/address_id/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/Person_entity/entityfields/address_id/displayValueProcess.js</displayValueProcess>
</entityField>
<entityActionField>
......@@ -945,12 +946,10 @@ Usually this is used for filtering COMMUNICATION-entries by a specified contact
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STANDARD_EMAIL_COMMUNICATION.displayValue</name>
<recordfield></recordfield>
<expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/standard_email_communication.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STANDARD_PHONE_COMMUNICATION.displayValue</name>
<recordfield></recordfield>
<expression>%aditoprj%/entity/Person_entity/recordcontainers/db/recordfieldmappings/standard_phone_communication.displayvalue/expression.js</expression>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
......
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