Are you trying to duplicate a file document or image document (“...trying to create objects/documents from the existing ones...”)? If yes, then import the module Community Commons from Mendix Markeptlace into your app and use the Java actions “DuplicateFileDocument” or “DuplicateImageDocument”.
Error after downloading