Expand my Community achievements bar.

SCM-120008 Unable to find key values for element 'Condition' ( document with Schema 'delivery' )

Avatar

Level 5

Hi Team,

 

I am using a workflow and trying to follow the article 

https://experienceleaguecommunities.adobe.com/t5/adobe-campaign-classic-questions/operation-id-campa...

 

When the save gets executed on the JS Activity, it leads to the error.  I had logged the info at multiple points and its that when save is called, the below error is thrown

 

dipendu_g_0-1656329139781.png

 

Request help on the same

 

Regards,

DG

 

25 Replies

Avatar

Community Advisor

Hello @dipendu_g;

 

Can you share your JS code? 

Br,

Amine 

Avatar

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

Hi @Amine_Abedour 

 

We are on ACC v8. One thing that i saw was, if I only have 2 lines of code, ie Line 1 and Line 4, the error still comes. The error only is triggered on save, if we comment that out, it works properly

Avatar

Community Advisor

Hello @dipendu_g 

Here's the right way to do it.

 

For Recurring delivery:

  • Select the delivery from the actions tab.
    Manoj_Kumar__0-1656395592198.png

     

  • Now select your delivery template and configure other options
  • In the advanced tab this code:
    delivery.operation_id = instance.operation_id;

For Continous delivery:

  • After your continuous delivery add a javascript activity.
  • and then the code:
    var delivery = NLWS.nmsDelivery.load(vars.deliveryId);
    delivery.operation_id=instance.operation_id;
    delivery.workflow_id=instance.id;
    delivery.save();​

 


     Manoj
     Find me on LinkedIn

Avatar

Level 5

@_Manoj_Kumar_, Thanks for your reply.

Actually when I execute the second piece of code, the one you mentioned for Continuous Delivery, I get the error SCM-120008 error, that I have raised in this 

 

Request, if you can help me by providing a resolution

 

BR, 

DG

 

 

Avatar

Community Advisor

Hello @dipendu_g 

Replace vars.deliveryId with the actual primary key of the delivery.

 

The first line should look like this:

var delivery = NLWS.nmsDelivery.load("1234");

 


     Manoj
     Find me on LinkedIn

Avatar

Community Advisor

Hello @dipendu_g  Can you share the screenshot of your code?


     Manoj
     Find me on LinkedIn

Avatar

Community Advisor

Hello @dipendu_g 

Could you please check the delivery Id again? Where are you picking this Id from?

 

I believe the delivery id is not correct and that is why you are getting the error.


     Manoj
     Find me on LinkedIn

Avatar

Level 5

Hi @_Manoj_Kumar_ ,

 

I crosschecked the deliveryd, from the Deliveries folder, also outputted the id in the JS and then hardcoded the same id. Please check the screenshots

 

dipendu_g_0-1656566683282.png

dipendu_g_1-1656566722285.png

dipendu_g_2-1656567362429.png

 

Avatar

Community Advisor

Hello, @dipendu_g I just checked this code and it is working for me with continuous delivery.


     Manoj
     Find me on LinkedIn

Avatar

Level 5

I think, the issue is somewhere else related to some schema. I am not sure what could be the reason. Any other place that needs to be checked looked, do let me know.

 

We are on v8, do we have any documentation what does the save() function do ?

 

 

Regards,

DG

Avatar

Community Advisor

@dipendu_g  The save function saves the delivery object.

 

Documentation link: save (adobe.com)


     Manoj
     Find me on LinkedIn

Avatar

Level 5

@_Manoj_Kumar_ , Thanks, but not sure what is the reason behind the issue

 

Regards,

DG

Avatar

Level 5

@_Manoj_Kumar_ @Adhiyan , Anybody who can suggest me something on this

 

Regards,

DG

Avatar

Administrator

Hi @dipendu_g,

Were you able to resolve this query or do you still need more help here? Do let us know.

Thanks!



Sukrity Wadhwa

Avatar

Level 5

@Sukrity_Wadhwa , No I am still facing the issue. I need some help in resolving the same

Update:

 

While investigating the issue, I found that, if I use the below Workflow Activities, directly in a workflow, there is no error

 

dipendu_g_0-1657770882299.png

The JS has the following code

logInfo("Delivery Id :" + vars.deliveryId );
logInfo("operation_id :" + instance.operation_id );
logInfo("workflow_id :" + instance.id );

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

The operation_id value as expected in 0, and the JS excutes properly

 

But if I take the same workflow and associate it with a Campaign ( i.e create the same Workflow inside a Campaign ), it gives me an error. The same error that I mentioned earlier, but in case all the operation_id has a value associated with it

 

dipendu_g_1-1657771155802.png

 

 

 

 

 

 

Regards,

DG

Avatar

Employee Advisor

Hi @dipendu_g 

Have you tried the following:

var delivery = nsm.delivery.load(vars.deliveryId);

Please be aware that using load function is memory intensive and NEVER EVER use it in a loop that you don't control the number of records in the loop, you will end up getting out of memory and will require a service restart, 

Thanks

Denis

Avatar

Level 5

Hi @Denis_Bozonnet,

 

I am getting the following error

dipendu_g_0-1657809816275.png

 

Looks like there was a typo, it should be "nms" probably. By doing that I still get the earlier error 

 

dipendu_g_0-1657811416657.png

 

 

Regards,

DG