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.