Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Gitlab Maintenance 28.03.2025 | 20:00 - 23:00 MEZ
Show more breadcrumbs
xrm
basic
Commits
a937dd26
Commit
a937dd26
authored
4 years ago
by
Sebastian Pongratz
Browse files
Options
Downloads
Patches
Plain Diff
#1071012-LedimportStandartadresse Organisation Address is set as main Address in the contact
parent
f3ec2d73
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/Leadimport_lib/process.js
+10
-10
10 additions, 10 deletions
process/Leadimport_lib/process.js
with
10 additions
and
10 deletions
process/Leadimport_lib/process.js
+
10
−
10
View file @
a937dd26
...
...
@@ -163,14 +163,15 @@ LeadImportUtils.importData = function(pDataFields, pDataTypes, pFieldDef, pField
var
orgObjID
=
""
;
var
orgsForDubCheck
=
""
;
var
persForDubCheck
=
""
;
var
orgRet
;
var
orgAddressID
=
null
;
var
orgRet
=
[
null
,
null
,
null
,
null
];
var
persRet
;
//------create organisation
if
(
LeadValues
[
"
NAME
"
].
trim
()
!=
""
)
//only if Organame is filled
{
orgObjID
=
"
Organisation
"
;
//for attribute
orgRet
=
LeadImportUtils
.
insertOrg
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
pUser
,
pDate
);
[
orgRet
[
0
],
orgRet
[
1
],
orgRet
[
2
],
orgRet
[
3
],
orgAddressID
]
=
LeadImportUtils
.
insertOrg
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
pUser
,
pDate
);
orgid
=
orgRet
[
0
];
orgContactId
=
orgRet
[
1
];
...
...
@@ -186,7 +187,7 @@ LeadImportUtils.importData = function(pDataFields, pDataTypes, pFieldDef, pField
if
(
LeadValues
[
"
LASTNAME
"
].
trim
()
!=
""
)
//only if lastname is filled
{
persObjID
=
"
Person
"
;
//for attribute
persRet
=
LeadImportUtils
.
insertPers
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
orgid
,
LeadValues
,
pUser
,
pDate
);
persRet
=
LeadImportUtils
.
insertPers
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
orgid
,
LeadValues
,
pUser
,
pDate
,
orgAddressID
);
persid
=
persRet
[
0
];
persContactId
=
persRet
[
1
];
...
...
@@ -574,11 +575,11 @@ LeadImportUtils.insertOrg = function(pDataFields, pDataTypes, pFieldDef, pField
workflow
.
startProcessByKey
(
"
leadprocess
"
,
processVariables
)
}
return
new
Array
(
orgid
,
contactId
,
entityFieldValues
,
true
);
return
new
Array
(
orgid
,
contactId
,
entityFieldValues
,
true
,
ContactValues
[
"
ADDRESS_ID
"
]
);
}
//return the ids of the existing organisation so that people who work for the same organisation are assigned to them
// OrgId ContactID
return
new
Array
(
ids
[
0
],
ids
[
1
]
,
entityFieldValues
,
false
);
return
new
Array
(
ids
[
0
],
ids
[
1
]
,
entityFieldValues
,
false
,
ids
[
2
]
);
}
/**
...
...
@@ -595,7 +596,7 @@ LeadImportUtils.insertOrg = function(pDataFields, pDataTypes, pFieldDef, pField
*
* @return {String []} (personId, contactId, duplicateMapping)
*/
LeadImportUtils
.
insertPers
=
function
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
pOrgId
,
pLeadValues
,
pUser
,
pDate
)
LeadImportUtils
.
insertPers
=
function
(
pDataFields
,
pDataTypes
,
pFieldDef
,
pFieldValues
,
pOrgId
,
pLeadValues
,
pUser
,
pDate
,
pOrgAddressID
)
{
var
isoLanguage
=
pLeadValues
[
"
ISOLANGUAGE
"
];
...
...
@@ -611,7 +612,6 @@ LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFiel
ContactValues
[
"
STATUS
"
]
=
"
CONTACTSTATACTIVE
"
;
//only insert active persons
ContactValues
[
"
PERSON_ID
"
]
=
persid
;
ContactValues
[
"
ADDRESS_ID
"
]
=
util
.
getNewUUID
();
ContactValues
[
"
DEPARTMENT
"
]
=
ContactInfoUtils
.
getContactDepartment
(
pLeadValues
);
ContactValues
[
"
CONTACTROLE
"
]
=
ContactInfoUtils
.
getContactRole
(
pLeadValues
);
ContactValues
[
"
CONTACTPOSITION
"
]
=
ContactInfoUtils
.
getContactPosition
(
pLeadValues
);
...
...
@@ -624,14 +624,14 @@ LeadImportUtils.insertPers = function(pDataFields, pDataTypes, pFieldDef, pFiel
else
{
ContactValues
[
"
ORGANISATION_ID
"
]
=
pOrgId
;
ContactValues
[
"
ADDRESS_ID
"
]
=
0
ContactValues
[
"
ADDRESS_ID
"
]
=
pOrgAddressID
}
var
contactId
=
LeadImportUtils
.
insertTable
(
pDataFields
,
pDataTypes
,
ContactValues
,
"
CONTACT
"
,
pUser
,
pDate
);
//Address
if
(
ContactValues
[
"
ADDRESS_ID
"
])
if
(
ContactValues
[
"
ADDRESS_ID
"
]
&&
!
ContactValues
[
"
ORGANISATION_ID
"
]
)
{
var
AddrValues
=
LeadImportUtils
.
setValues
(
pDataFields
[
"
ADDRESS
"
],
pFieldDef
,
pFieldValues
);
AddrValues
[
"
ADDRESSID
"
]
=
ContactValues
[
"
ADDRESS_ID
"
];
...
...
@@ -954,7 +954,7 @@ LeadImportUtils.scanLeadDups = function(pAllContactData)
LeadImportUtils
.
checkOrgDup
=
function
(
pLeadValues
)
{
// search whether the organisation already exists
var
query
=
newSelect
(
"
ORGANISATIONID, CONTACTID
"
)
var
query
=
newSelect
(
[
"
ORGANISATIONID, CONTACTID
, ADDRESSID
"
]
)
.
from
(
"
ORGANISATION
"
)
.
join
(
"
CONTACT
"
,
"
ORGANISATIONID = CONTACT.ORGANISATION_ID
"
)
.
join
(
"
ADDRESS
"
,
"
ADDRESSID = ADDRESS_ID
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment