Skip to content
Snippets Groups Projects
Commit de9952ab authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

Campaign: delete all from campaign

parent 3f14107a
No related branches found
No related tags found
No related merge requests found
...@@ -203,6 +203,7 @@ ...@@ -203,6 +203,7 @@
<name>db</name> <name>db</name>
<alias>Data_alias</alias> <alias>Data_alias</alias>
<onDBInsert>%aditoprj%/entity/Campaign_entity/recordcontainers/db/onDBInsert.js</onDBInsert> <onDBInsert>%aditoprj%/entity/Campaign_entity/recordcontainers/db/onDBInsert.js</onDBInsert>
<onDBDelete>%aditoprj%/entity/Campaign_entity/recordcontainers/db/onDBDelete.js</onDBDelete>
<linkInformation> <linkInformation>
<linkInformation> <linkInformation>
<name>f3893829-3af2-4e55-ae85-c3a24411a8b8</name> <name>f3893829-3af2-4e55-ae85-c3a24411a8b8</name>
......
import("system.db");
import("system.vars");
import("Sql_lib");
var currentId = vars.getString("$field.SALESPROJECTID");
if (currentId)
{
var toDelete = [
"CAMPAIGNCOST",
"CAMPAIGNPARTICIPANT",
"CAMPAIGNPARTICIPANTLOG",
"CAMPAIGNSTEP",
];
toDelete = toDelete.map(function(pTable)
{
return [pTable, SqlCondition.equals(pTable + ".CAMPAIGN_ID", currentId, "1=2")]
});
db.deletes(toDelete);
}
\ No newline at end of file
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