Skip to content
Snippets Groups Projects
Commit 85d5b0b4 authored by Sebastian Pongratz's avatar Sebastian Pongratz :ping_pong:
Browse files

Merge branch 'sales_1086776_FixDistrictSetStatusInReview' into '2021.2.0'

[Projekt: xRM-Sales][TicketNr.: 1086776][Zuordnung Betreuer - Status in...

See merge request xrm/basic!1313
parents 904148a0 3163d1de
No related branches found
No related tags found
No related merge requests found
...@@ -215,7 +215,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId ...@@ -215,7 +215,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
for (var i = 0; i < arrOrgContactIds.length; i++) for (var i = 0; i < arrOrgContactIds.length; i++)
{ {
resStatus = orgContactStatusObj[arrOrgContactIds[i]] == $KeywordRegistry.contactStatus$inactive() ? $KeywordRegistry.contactStatus$inReview() : resStatus;//set to in review if org is inactive var newResStatus = orgContactStatusObj[arrOrgContactIds[i]] == $KeywordRegistry.contactStatus$inactive() ? $KeywordRegistry.contactStatus$inReview() : resStatus;//set to in review if org is inactive
//insert new assignments //insert new assignments
var valsInsert = [ var valsInsert = [
...@@ -224,7 +224,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId ...@@ -224,7 +224,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
pDistrictId, pDistrictId,
resContactId, resContactId,
resRole, resRole,
resStatus, newResStatus,
resValidFrom, resValidFrom,
resValidUntil, resValidUntil,
$KeywordRegistry.districtOrigin$auto(), //origin $KeywordRegistry.districtOrigin$auto(), //origin
...@@ -243,14 +243,14 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId ...@@ -243,14 +243,14 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
insertArray.push(["DISTRICTCONTACT", colsInsert, null, valsInsert]); insertArray.push(["DISTRICTCONTACT", colsInsert, null, valsInsert]);
} }
else if (checkexistingEntry != undefined && checkexistingEntry["status"] != $KeywordRegistry.contactStatus$inReview() && else if (checkexistingEntry != undefined && checkexistingEntry["status"] != $KeywordRegistry.contactStatus$inReview() &&
(checkexistingEntry["status"] != resStatus || checkexistingEntry["role"] != resRole (checkexistingEntry["status"] != newResStatus || checkexistingEntry["role"] != resRole
|| checkexistingEntry["validFrom"] != resValidFrom || checkexistingEntry["validUntil"] != resValidUntil || checkexistingEntry["validFrom"] != resValidFrom || checkexistingEntry["validUntil"] != resValidUntil
|| checkexistingEntry["visitFrequency"] != resVisitFrequency))// value changed -> update this dataset || checkexistingEntry["visitFrequency"] != resVisitFrequency))// value changed -> update this dataset
{ {
updated++; updated++;
updateStatements.push(newWhere("DISTRICTCONTACT.DISTRICTCONTACTID", checkexistingEntry["districtContactId"]).buildUpdateStatement({ updateStatements.push(newWhere("DISTRICTCONTACT.DISTRICTCONTACTID", checkexistingEntry["districtContactId"]).buildUpdateStatement({
"ADVISER_ROLE": resRole, "ADVISER_ROLE": resRole,
"STATUS": resStatus, "STATUS": newResStatus,
"VALID_FROM": resValidFrom, "VALID_FROM": resValidFrom,
"VALID_UNTIL": resValidUntil, "VALID_UNTIL": resValidUntil,
"VISITFREQUENCY": resVisitFrequency, "VISITFREQUENCY": resVisitFrequency,
......
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