Skip to content
Snippets Groups Projects
Commit 1e6fb46d authored by Sebastian Listl's avatar Sebastian Listl :speech_balloon:
Browse files

Merge branch '2020.2_AV_EmailImport_Orgs' into '2020.2'

2020.2 Add Organisations to Activity as Links in Email Import

See merge request xrm/basic!492
parents e717e3ee bd8578a8
No related branches found
No related tags found
No related merge requests found
......@@ -266,7 +266,23 @@ IncomingEmailExecutor.prototype._getProcessingFunction = function (pIsSender, pT
}
else
{
var link = [(contactPersonId == "" ? "Organisation" : "Person"), contactId];
var context = contactPersonId == "" ? "Organisation" : "Person"
if(context == "Person")//add Organisation to the Activity as Link
{
var orgData = newSelect(["CONTACT.CONTACTID", "CONTACT.STATUS"], this._alias)
.from("CONTACT")
.join("CONTACT", "anyContact.ORGANISATION_ID = CONTACT.ORGANISATION_ID and CONTACT.PERSON_ID is null", "anyContact")
.whereIfSet(["CONTACT", "CONTACTID", "anyContact"], contactId)
.arrayRow()
if (orgData[1] == $KeywordRegistry.contactStatus$active())
pTargetArray["prefered"].push(["Organisation", orgData[0]]);
else
pTargetArray["failback"].push(["Organisation", orgData[0]]);
}
var link = [context, contactId];
if (isContactActive)
pTargetArray["prefered"].push(link);
else
......
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