Skip to content
Snippets Groups Projects
Commit 3163d1de authored by Benjamin Ulrich's avatar Benjamin Ulrich :speech_balloon:
Browse files

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

[Projekt: xRM-Sales][TicketNr.: 1086776][Zuordnung Betreuer - Status in Betreuer wird von zur Prüfung auf aktiv gesetzt, wenn bei verantwortlcihen was geändert und gebiet neu gesetzt wird]
parent 1094d2ac
No related branches found
No related tags found
No related merge requests found
......@@ -215,7 +215,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
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
var valsInsert = [
......@@ -224,7 +224,7 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
pDistrictId,
resContactId,
resRole,
resStatus,
newResStatus,
resValidFrom,
resValidUntil,
$KeywordRegistry.districtOrigin$auto(), //origin
......@@ -243,14 +243,14 @@ DistrictUtils.assignDistrict = function (pDistrictId, pAppliedFilter, pContactId
insertArray.push(["DISTRICTCONTACT", colsInsert, null, valsInsert]);
}
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["visitFrequency"] != resVisitFrequency))// value changed -> update this dataset
{
updated++;
updateStatements.push(newWhere("DISTRICTCONTACT.DISTRICTCONTACTID", checkexistingEntry["districtContactId"]).buildUpdateStatement({
"ADVISER_ROLE": resRole,
"STATUS": resStatus,
"STATUS": newResStatus,
"VALID_FROM": resValidFrom,
"VALID_UNTIL": resValidUntil,
"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