Skip to content
Snippets Groups Projects
Commit dd8449f2 authored by David Büchler's avatar David Büchler
Browse files

Fixed bug where the default campaignStep wasnt auto selected

Now the CampaignParticipantLog gets updated correctly
parent 5e1d8696
No related branches found
No related tags found
No related merge requests found
import("system.logging");
import("system.vars");
import("system.neon");
import("Campaign_lib");
var stepId;
CampaignUtils.getDefaultCampaignStep(vars.get("$field.CAMPAIGN_ID"));
stepId = CampaignUtils.getDefaultCampaignStep(vars.get("$field.CAMPAIGN_ID"));
neon.setFieldValue("$field.CAMPAIGNSTEP_ID", stepId);
\ No newline at end of file
import("system.logging");
import("system.vars");
import("Campaign_lib");
import("system.result");
......
......@@ -36,6 +36,7 @@ else
}
var statementArray = [];
var logArray = [];
logging.log("isUpdate -> " + isUpdate);
for (participant in participants)
{
......@@ -51,7 +52,7 @@ for (participant in participants)
let valsCampaignParticipantLog = new Array(participants[participant], campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date"));
statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, updatedValues, condition]);
statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
logArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
}
else
{
......@@ -68,7 +69,7 @@ for (participant in participants)
let valsCampaignParticipantLog = new Array(campaignParticipantId, campaignId, newCampaignStepId, campaignParticipantLogId, vars.get("$sys.user"), vars.get("$sys.date"));
statementArray.push(["CAMPAIGNPARTICIPANT", cols, null, valsCampaignParticipant]);
statementArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
logArray.push(["CAMPAIGNPARTICIPANTLOG", colNamesCampaignParticipantLog, null, valsCampaignParticipantLog]);
}
}
......@@ -76,3 +77,5 @@ if(isUpdate == "true")
db.updates(statementArray)
else
db.inserts(statementArray);
db.inserts(logArray);
\ No newline at end of file
......@@ -166,8 +166,7 @@ CampaignUtils.getDefaultCampaignStep = function(pCampaignId)
{
let selectQuery = "select CAMPAIGNSTEPID from CAMPAIGNSTEP " +
"where CAMPAIGNSTEP.CAMPAIGN_ID = '" + pCampaignId + "' " +
"order by CAMPAIGNSTEP.SORTING asc " +
"fetch first 1 rows only";
"order by CAMPAIGNSTEP.SORTING asc";
return db.cell(selectQuery)
......
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