Skip to main content
Level 4
Feb 27, 2020 2:05 PM UTC
Solved

Looking for delivery templates with an operation (operation id > 0)

Hello,

 

From a delivery (continuous, recurring, create from tpl...), when we look for a delivery template, ACC automatically adds a condition "[@operation-id] = 0". Why is the reason behind this?

 

We would like our deliveries created from the delivery template to be linked to an operation/campaign.

 

With traceview we found out that this condition is added by the workflow input form:

 

Is it safe to comment this line and completely turn off this feature?

 

Best regards

Florian

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
anupk2111
anupk2111Accepted solution
Level 2
Feb 28, 2020 11:02 AM UTC

Hi Florian,

If you use a recurring delivery or Email delivery activity, you might have noticed that the deliveries are linked to the campaigns already and the operation ID is not zero. However in case of Standard or continuous delivery you need to use an additional script to link the delivery to the campaign/workflow. This script can be added in Javascript code activity just after the delivery. The following code can be used to do so.

 

var delivery = NLWS.nmsDelivery.load(vars.deliveryId);
delivery.operation_id=instance.operation_id;
delivery.workflow_id=instance.id;
delivery.save();

 

I hope that helps.

 

Thanks,

Anup

3 replies

anupk2111
anupk2111Accepted solution
Level 2
Feb 28, 2020 11:02 AM UTC

Hi Florian,

If you use a recurring delivery or Email delivery activity, you might have noticed that the deliveries are linked to the campaigns already and the operation ID is not zero. However in case of Standard or continuous delivery you need to use an additional script to link the delivery to the campaign/workflow. This script can be added in Javascript code activity just after the delivery. The following code can be used to do so.

 

var delivery = NLWS.nmsDelivery.load(vars.deliveryId);
delivery.operation_id=instance.operation_id;
delivery.workflow_id=instance.id;
delivery.save();

 

I hope that helps.

 

Thanks,

Anup

Translate
Level 2
Feb 2, 2023 7:50 AM UTC

Hi  @anupk2111 

 

This solution works.

 

Thanks.

Translate
Amine_Abedour
Community Advisor and User Group Leader
Community Advisor and User Group Leader
Feb 3, 2023 9:23 AM UTC

hello @neelamb91,

 

If you want an even simpler solution, you can put directly the bellow code in the script tab of the delivery activity :

delivery.operation_id=instance.operation_id; delivery.workflow_id=instance.id;

Like this : 

With this solution, you'll have one less JS activity in your workflow, and no need to load then save the delivery.

 

Br,

Amine 

Translate
Amine ABEDOUR