Maybe someone knows how to attach ContentDocument to record through Apex? I need to copy ContentDocuments (which are in Google Doc's, Notes and Attachments related list) from one Object to another. I tried to insert ContentDocument and AttachedContentDocument but we can't do insert operation on these objects. I can insert ContentVersion but don't know is there a way to attach it to record?
I will appreciate any kind of help.