As that method comment (Copies attachments of the given document as temporary attachments for specified form, This method is intended to be used only during new culture version of the document creation) says, it is primarily meant as a support method for the UI form.
The overall process in the UI works like this:
- You choose to create a new culture version of a document as a copy of existing one
- New culture version is not yet created, but its attachments are copied as temporary using this method and assigned to the form with the given form GUID, so they can be later attached to a newly created document
- Once the form is saved, attachments are assigned to the newly created document (with its new DocumentID), and the form GUID is removed from them to change them from temporary to regular ones
So even if you would call this method with any GUID outside of this process, attachments would be created as temporary without proper foreign key to the newly created document.
To just copy attachments from one document to another, use regular API methods
- DocumentHelper.GetAttachments to get attachments from source
- DocumentHelper.AddAttachment to add these attachments to target one-by-one, use variant with (object file) parameter which accepts AttachmentInfo as one of the options