Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

Seed Removal via JS

courtneyd578424
Level 2
Level 2

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

2 Replies
florentlb
Level 10
Level 10

Hi Courtney,

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

Florent