Seed Removal via JS

Avatar

Avatar
Validate 1
Level 2
courtneyd578424
Level 2

Likes

3 likes

Total Posts

19 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
courtneyd578424
Level 2

Likes

3 likes

Total Posts

19 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
courtneyd578424
Level 2

27-11-2017

1359532_pastedImage_30.png

Trying to send an email delivery "Real Send", then run a JS script to duplicate it and then build another delivery, without seeds and without waves. I am getting this error message on the second delivery: "Error while executing the method 'PrepareMessage' of service 'nms:delivery'. The value 'insertOrUpdate' of element 'Seed (seedMember)' is not a valid reconciliation operation (document with schema 'delivery')". What do I need to add to the JS to fix this? Thanks!

Here's the JS

// query the database to find the delivery

   var send = xtk.queryDef.create(

     <queryDef schema="nms:delivery" operation="get">

       <select>

         <node expr="@id"/>

         <node expr="@label"/>

         <node expr="[@operation-id]"/>

         <node expr="[@workflow-id]"/>

       </select>

       <where>

         <condition expr={"@FCP=0 and [@workflow-id]= " + instance.id}/>

       </where>

     </queryDef>).ExecuteQuery()

  

   // create a new delivery object and initialize it by doing a copy of delivery

   var delivery = nms.delivery.create()

   delivery.Duplicate("nms:delivery|" + send.@id)

   // append 'seed' to the delivery label

   delivery.label = send.@label + " seed"

  

   // link the delivery to the operation to make sure it will be displayed in the campaign dashboard. This attribute needs to be set manually here since

   // the Duplicate() method has reset it to its default value => 0

   delivery.operation_id = send.@["operation-id"]

   delivery.workflow_id = send.@["workflow-id"]

   // adjust some delivery parameters to make it compatible with the "Prepare and start" option selected in the Delivery tab of this activity

   delivery.scheduling.validationMode = "manual"

   delivery.scheduling.delayed = 0

   delivery.scheduling.waves.enabled = 0

   // save the delivery in database

   delivery.save()

   // store the new delivery Id in event variables

   vars.deliveryId = delivery.id

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
courtneyd578424
Level 2

Likes

3 likes

Total Posts

19 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
courtneyd578424
Level 2

Likes

3 likes

Total Posts

19 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
courtneyd578424
Level 2

04-12-2017

Not yet.

Avatar

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile

Avatar
Give Back 50
Level 10
florentlb
Level 10

Likes

237 likes

Total Posts

1,109 posts

Correct reply

239 solutions
Top badges earned
Give Back 50
Give Back 5
Give Back 3
Give Back 25
Give Back 200
View profile
florentlb
Level 10

04-12-2017

Hi Courtney,

I don't know the method to do that. Did you fin a way in the meantime?

Florent