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

How to use Duplicate and DuplicateTo

Avatar

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile

Avatar
Springboard
MVP
MarcelSzimonisz
MVP

Likes

102 likes

Total Posts

225 posts

Correct Reply

56 solutions
Top badges earned
Springboard
Establish
Contributor
Give Back 25
Give Back 10
View profile
MarcelSzimonisz
MVP

05-06-2020

Hello All,

I have no idea how to use these two. Basically i want to duplicate a record from javascript. Do you have any idea how to use these or how to do it other than manually pass the settings from one to another?

 

Marcel

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 2
isahore
Level 2

Likes

8 likes

Total Posts

36 posts

Correct Reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Level 2
isahore
Level 2

Likes

8 likes

Total Posts

36 posts

Correct Reply

11 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
isahore
Level 2

09-06-2020

Hi @MarcelSzimonisz ,

Here is how you do it in javascript:

I have taken an example of duplicating a delivery template.

 

var del1 = nms.delivery.create();
del1.Duplicate("nms:delivery|<<id of the delivery which you want to duplicate (integer)>>");
del1.save();

 

var del2 = nms.delivery.create();
del2.DuplicateTo("nms:delivery|<<id of the delivery which you want to duplicate (integer)>>","xtk:folder|<<id of the folder to which you want to duplicate your delivery to (integer)>>");
del2.save();

 

After the Duplicate() or DuplicateTo() methods are executed, the newly created delivery (copy of the original one) is available but not saved to the database yet.

Before the .save() you can modify as many properties of the delivery you want to via code as well.

The same way you can use it for other types of entities in Adobe Campaign, provided the schema and id (primary key) are correct.

 

Hope that helps.

Cheers,

Ishan

Answers (1)

Answers (1)

Avatar

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

254 likes

Total Posts

366 posts

Correct Reply

150 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

254 likes

Total Posts

366 posts

Correct Reply

150 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile
DavidKangni
MVP

08-06-2020

Hi Marcel,

 

Duplicate --> let you duplicate an object in the same folder

Duplicate to --> let you duplicate an object to another folder that you will select during the process

 

Thanks

David