Skip to content
Snippets Groups Projects
Commit 3e0f8c52 authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Merge branch '#1057408-LeadQuickAcquisitionFixAdressResolving' into '2020.1'

#1057408: Fixed bug.

See merge request xrm/basic!205

(cherry picked from commit a2d9c3a1)

225f8ee7 #1057408: Fixed bug.
54cdc25a #1057408: Customized merge request.
5fffb792 #1057408: Customized merge request.
parent 8dd7e9ab
No related branches found
No related tags found
No related merge requests found
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", response.address);
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