Skip to main content

Uploading to Relation DM with code

With the code at the bottom, you can upload documents in relation to the DM.

public void btnRelation_OnClick(Object sender, EventArgs e)
{
eBAConnection con = CreateServerConnection();
Con. open();
FileSystem fs = con. FileSystem;
DMFile dmFile = fs. GetFile("Training/Sample.pdf"); The path of the file that we will add to the relations in the dm. In other words, we will add Attachmenttan relations to this file
DMFile formeBA = fs. GetWorkflowFile(id);
foreach(DMFileContent content in formeBA.GetAttachments("Category1")) //We access the attachments in the form
{
DMFile file=fs. CreateFile(@"Education/"+content. ContentName); We record the attachment in the form to Dme.
fileformed. Upload(formeBA.CreateAttachmentContentDownloadStream("Category1",content. ContentName));

dmDosya.AddRelation(@"Training/"+content. ContentName,"Category1"); We are adding to the document in the dm.
}
Con. Close();

}