From 0e10ea5fad76bbf53fd3bb401bc40687819cf934 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 4 May 2020 00:51:47 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 6939205..ac6618d 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -1296,7 +1296,7 @@ namespace AyaNova.PlugIn.V8 //Attachments / FILES - await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrderItem); + await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrder); //----- bool repost = false; @@ -1924,7 +1924,7 @@ namespace AyaNova.PlugIn.V8 #endregion attachments #region Assigned docs exporter - private async System.Threading.Tasks.Task ExportDocs(TypeAndID tid, AssignedDocs docs, ProgressForm progress) + private async System.Threading.Tasks.Task ExportDocs(TypeAndID tid, AssignedDocs docs, ProgressForm progress, util.AyaType specificRavenType = util.AyaType.NoType) { @@ -1971,7 +1971,12 @@ namespace AyaNova.PlugIn.V8 MultipartFormDataContent formDataContent = new MultipartFormDataContent(); //Form data like the bizobject type and id - formDataContent.Add(new StringContent(((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString()), name: "AttachToObjectType"); + string RavenTypeAsString = ""; + if (specificRavenType != util.AyaType.NoType) + RavenTypeAsString = ((int)specificRavenType).ToString(); + else + RavenTypeAsString = ((int)util.RootObjectToAyaType(tid.RootObjectType)).ToString(); + formDataContent.Add(new StringContent(RavenTypeAsString), name: "AttachToObjectType"); formDataContent.Add(new StringContent(Map[tid.ID].ToString()), name: "AttachToObjectId"); formDataContent.Add(new StringContent(doc.Description + " (" + ImportTag + ")"), name: "Notes"); formDataContent.Add(new StringContent(dFileData.ToString()), name: "FileData");