Skip to content
Snippets Groups Projects
Verified Commit ddf7cdc0 authored by Pascal Neub's avatar Pascal Neub
Browse files

[Projekt: xRM-Sales][TicketNr.: 2001680][Checklistentryvalues werden beim...

[Projekt: xRM-Sales][TicketNr.: 2001680][Checklistentryvalues werden beim Löschen von Salesprojects nicht berücksichtigt]
parent 1da61258
No related branches found
No related tags found
No related merge requests found
......@@ -9,45 +9,35 @@ var currentId = vars.getString("$field.SALESPROJECTID");
if (currentId)
{
var toDelete = [
"SALESPROJECT_MILESTONE",
"SALESPROJECT_TOUCHPOINT",
"CLASSIFICATIONSTORAGE"
var directRefTables = [
"SALESPROJECT_MILESTONE",
"SALESPROJECT_TOUCHPOINT"
];
var objectTypeRefTables = [
"CLASSIFICATION",
"CLASSIFICATIONSTORAGE",
"COMPETITION",
"OBJECTMEMBER",
"FORECAST",
"CHECKLISTENTRYVALUE"
];
toDelete = toDelete.map(function(pTable)
var deleteStatements = [];
directRefTables.forEach(function(pTable)
{
var cond;
if(pTable != "CLASSIFICATIONSTORAGE")
cond = newWhere(pTable + ".SALESPROJECT_ID", currentId)
else
cond = newWhere(pTable + ".OBJECT_ROWID", currentId)
return [pTable, cond.build()];
var cond = newWhere(pTable + ".SALESPROJECT_ID", currentId);
deleteStatements.push([pTable, cond.build()]);
});
var modulesToDelete = [
"CLASSIFICATION",
"COMPETITION",
"OBJECTMEMBER",
"FORECAST"
];
toDelete = toDelete.concat(modulesToDelete.map(function(pTableComp)
objectTypeRefTables.forEach(function(pTable)
{
var cond = newWhere(pTableComp + ".OBJECT_TYPE", ContextUtils.getCurrentContextId())
.and(pTableComp + ".OBJECT_ROWID", currentId)
return [pTableComp, cond.build()];
}));
db.deletes(toDelete);
var cond = newWhere(pTable + ".OBJECT_TYPE", ContextUtils.getCurrentContextId())
.and(pTable + ".OBJECT_ROWID", currentId)
deleteStatements.push([pTable, cond.build()]);
});
db.deletes(deleteStatements);
}
new AttributeRelationQuery(currentId, null, ContextUtils.getCurrentContextId())
.deleteAllAttributes();
WorkflowSignalSender.deleted();
\ No newline at end of file
WorkflowSignalSender.deleted();
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