Hi Experts,
NLWS.xtkWorkflow.PostEvent("WKF_ESG", "signal", "", {variables: {"recipientId":parseInt(ctx.recipient.@id),"prospect":1,}}, false);
xtk.workflow.PostEvent("WKF_ESG", "signal", "", <variables recipientId={parseInt(ctx.recipient.@id)} prospect="1" />, false);
https://docs.adobe.com/content/help/en/campaign-classic/technicalresources/api/p-14.html
I correlated the following two errors also each time the webapp used the NLWS version; which matches the webapp sending the command twice.
2021-07-31 00:22:06 JST-310034 Function logonEscalation used by 'Anonymous account' to become 'Web applications agent (webapp)' (context=rvletContext).
2021-07-31 00:20:47 JST-310034 Function logonEscalation used by 'Anonymous account' to become 'Web applications agent (webapp)' (context=rvletContext).
Solved! Go to Solution.
x
var rcpObj = nms.recipient.load(ctx.recipient.@id);
var rcpXml = {recipient: {_key: "id", id: rcpObj.id}}
if (!rcpObj.doubleOptin) {
nms.subscription.Unsubscribe('SVC_DO_CAZ', rcpXml);
nms.subscription.Unsubscribe('SVC_DO_SCH', rcpXml);
rcpObj.doubleOptin=1
rcpObj.save();
/**********************************/
if (rcpObj.doubleOptin == 1)
{
if (rcpObj.origin == "ESG") {
if (rcpObj.lawfulBasis == 2 || rcpObj.lawfulBasis == 3) {
nms.subscription.Subscribe('SVC52', rcpXml, false);
}
var goal = sqlSelect("latest,@id:string",
"SELECT MAX(iGoalsId) as xyz FROM CusGoals WHERE biRecipientId='"+parseInt(ctx.recipient.@id)+"' "); //get latest goalId
xtk.workflow.PostEvent("WKF_ESG", "signal", "", <variables recipientId={parseInt(ctx.recipient.@id)} prospect="1" goalId={parseInt(goal.latest.@id)} />, false); //start delivery workflow and send variables
logInfo("Recipient Verified: "+rcpObj.email+" "+parseInt(goal.latest.@id)+" "+parseInt(ctx.recipient.@id));
} else if(rcpObj.origin == "Carbon") {
//dosomething
}
}
/*********************************/
} else if (rcpObj.doubleOptin) {
logInfo("Recipient already optedin: "+rcpObj.email+" "+parseInt(ctx.recipient.@id));
}
My solution was to enhance my double opt-in logic, here is a free snippet in case it may help others with their tasks
x
var rcpObj = nms.recipient.load(ctx.recipient.@id);
var rcpXml = {recipient: {_key: "id", id: rcpObj.id}}
if (!rcpObj.doubleOptin) {
nms.subscription.Unsubscribe('SVC_DO_CAZ', rcpXml);
nms.subscription.Unsubscribe('SVC_DO_SCH', rcpXml);
rcpObj.doubleOptin=1
rcpObj.save();
/**********************************/
if (rcpObj.doubleOptin == 1)
{
if (rcpObj.origin == "ESG") {
if (rcpObj.lawfulBasis == 2 || rcpObj.lawfulBasis == 3) {
nms.subscription.Subscribe('SVC52', rcpXml, false);
}
var goal = sqlSelect("latest,@id:string",
"SELECT MAX(iGoalsId) as xyz FROM CusGoals WHERE biRecipientId='"+parseInt(ctx.recipient.@id)+"' "); //get latest goalId
xtk.workflow.PostEvent("WKF_ESG", "signal", "", <variables recipientId={parseInt(ctx.recipient.@id)} prospect="1" goalId={parseInt(goal.latest.@id)} />, false); //start delivery workflow and send variables
logInfo("Recipient Verified: "+rcpObj.email+" "+parseInt(goal.latest.@id)+" "+parseInt(ctx.recipient.@id));
} else if(rcpObj.origin == "Carbon") {
//dosomething
}
}
/*********************************/
} else if (rcpObj.doubleOptin) {
logInfo("Recipient already optedin: "+rcpObj.email+" "+parseInt(ctx.recipient.@id));
}
My solution was to enhance my double opt-in logic, here is a free snippet in case it may help others with their tasks
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies