Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
ParthaSarathy
ParthaSarathyAccepted solution
Community Advisor
Oct 10, 2023 11:51 AM UTC

Hi @campaignerforlife ,

Create a JS, and add below script

 

var frequency = 10 * 1000 // 10 seconds task.wait(frequency)

 

~  ParthaSarathy S

4 replies

LakshmiPravallika
Community Advisor
Community Advisor
Oct 9, 2023 12:55 PM UTC

Hi @campaignerforlife ,

 

Could you Please explain which activity needs to be created in runtime and also the use case for this issue ?

 

If it is a delivery activity, then yes, it can be created in runtime using JavaScript.

 

PFA the sample code

 

var delivery = nms.delivery.create();
delivery.Duplicate("nms:delivery|" + vars.ID);
delivery.save();
vars.deliveryId = delivery.id;
logInfo("vars.deliveryId: "+vars.deliveryId);

 

Regards,

Pravallika.

Translate
CampaignerForLife
Level 5
Oct 10, 2023 11:17 AM UTC

Lets say I want to create a "Wait" activity in a workflow using Javascript, how could I do it?

Translate
ParthaSarathy
Community Advisor
ParthaSarathyCommunity AdvisorAccepted solution
Community Advisor
Oct 10, 2023 11:51 AM UTC

Hi @campaignerforlife ,

Create a JS, and add below script

 

var frequency = 10 * 1000 // 10 seconds task.wait(frequency)

 

Translate
~  ParthaSarathy S