Hi Team,
I am using a workflow and trying to follow the article
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
Request help on the same
Regards,
DG
Views
Replies
Total Likes
Views
Replies
Total Likes
var delivery = NLWS.nmsDelivery.load(vars.deliveryId); delivery.operation_id=instance.operation_id; delivery.workflow_id=instance.id; delivery.save();
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
Views
Replies
Total Likes
@Amine_Abedour , @Adhiyan , @Darren_Bowers Please suggest / help.
Views
Replies
Total Likes
Hello @dipendu_g
Here's the right way to do it.
For Recurring delivery:
For Continous delivery:
var delivery = NLWS.nmsDelivery.load(vars.deliveryId); delivery.operation_id=instance.operation_id; delivery.workflow_id=instance.id; delivery.save();
@_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
Views
Replies
Total Likes
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");
Views
Replies
Total Likes
Views
Replies
Total Likes
Hello @dipendu_g Can you share the screenshot of your code?
Views
Replies
Total Likes
Views
Replies
Total Likes
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.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Hello, @dipendu_g I just checked this code and it is working for me with continuous delivery.
Views
Replies
Total Likes
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
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Views
Replies
Total Likes
Hi @dipendu_g,
Were you able to resolve this query or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes
@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
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
Regards,
DG
Views
Replies
Total Likes
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
Hi @Denis_Bozonnet,
I am getting the following error
Looks like there was a typo, it should be "nms" probably. By doing that I still get the earlier error
Regards,
DG
Views
Replies
Total Likes
Views
Likes
Replies