Skip to content
Snippets Groups Projects
Commit 225f8ee7 authored by Daniel Tran's avatar Daniel Tran
Browse files

#1057408: Fixed bug.

parent a2207eb6
No related branches found
No related tags found
No related merge requests found
......@@ -106,6 +106,12 @@
<fieldName>FullAddressValidation</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>4301c0b9-401f-43af-bd21-8a034aaa7d55</name>
<entityName>QuickEntry_entity</entityName>
<fieldName>AdressValidation</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......
......@@ -224,6 +224,14 @@
<stateProcess>%aditoprj%/entity/QuickEntry_entity/entityfields/leadquickacquisition/stateProcess.js</stateProcess>
<onValueChange>%aditoprj%/entity/QuickEntry_entity/entityfields/leadquickacquisition/onValueChange.js</onValueChange>
</entityField>
<entityConsumer>
<name>AdressValidation</name>
<dependency>
<name>dependency</name>
<entityName>AddressValidation_entity</entityName>
<fieldName>FullAddressValidation</fieldName>
</dependency>
</entityConsumer>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.neon");
import("system.vars");
import("Entity_lib");
import("system.entities");
import("KeywordRegistry_basic");
import("LeadQuickAcquisition_lib");
......@@ -37,9 +38,38 @@ if(vars.get("$local.value"))
}
else if(response.address)
{
neon.addRecord("OrgAddresses", {
var orgAddressPresets = {
"AddressSearch" : response.address
});
};
var getRowsConfig = entities.createConfigForLoadingRows()
.entity("AddressValidation_entity")
.provider("FullAddressValidation")
.fields(["CITY", "ZIP", "STREET"])
.addParameter("CurrentValue_param", "Ritter-von-Schoch-Straße 5, 84036 Landshut");
var rows = entities.getRows(getRowsConfig);
if (rows.length > 0)
{
var affectedRow = rows[0];
if (affectedRow["CITY"])
orgAddressPresets.CITY = affectedRow["CITY"];
if (affectedRow["ZIP"])
{
orgAddressPresets.ZIP = affectedRow["ZIP"];
}
if (affectedRow["STREET"])
{
orgAddressPresets.ADDRESS = affectedRow["STREET"];
}
}
neon.addRecord("OrgAddresses", orgAddressPresets);
}
if(response.companyName) neon.setFieldValue("$field.ORGANISATION_NAME", response.companyName);
......
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