From e0b635ad09d428c4232b5ff09c32b4f03ab86362 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 11 May 2020 23:43:30 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 39 ++++++++++++++++++++------ 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 8d5cd3a..fd67191 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -123,7 +123,7 @@ namespace AyaNova.PlugIn.V8 public void CommandSelectedForSingleObject(string commandKey, RootObjectTypes objectType, object ayaNovaObject) { - util.PRE_RELEASE_VERSION_STRING = "Pre-release test "+ this.PluginVersion; + util.PRE_RELEASE_VERSION_STRING = "Pre-release test " + this.PluginVersion; if (!User.CurrentUserIsAnAdministrator) { @@ -295,8 +295,8 @@ namespace AyaNova.PlugIn.V8 await ExportServiceWorkorders(progress); //todo: these are now invalid and awaiting RAVEN end implementation //after which can copy mostly from service workorder block - // await ExportQuotes(progress); - // await ExportPMs(progress); + // await ExportQuotes(progress); + // await ExportPMs(progress); //NOTE: when get to PRIORITY, or WORKORDER STATUS be sure to add color code as per already done in USER export @@ -1357,7 +1357,27 @@ namespace AyaNova.PlugIn.V8 var DateCustomFields = await ExportCustomFieldSchema(ocf, "WorkorderItem", "WorkOrderItem"); //Step 2: export the objects - WorkorderServiceList pl = WorkorderServiceList.GetList(""); + //sort by woid + // var crit = @" + // + // + // + // + // + // + // + // + // + // + // + //"; + + var crit = @" + + +"; + + WorkorderServiceList pl = WorkorderServiceList.GetList(crit); progress.Append("Exporting " + pl.Count.ToString() + " Service " + ObjectTypeName + "s"); foreach (WorkorderServiceList.WorkorderServiceListInfo i in pl) @@ -1369,8 +1389,8 @@ namespace AyaNova.PlugIn.V8 Workorder c = Workorder.GetItem(i.LT_O_Workorder.Value); if (IsDuplicateMapItem(c.ID, c.WorkorderService.ServiceNumber.ToString(), progress)) continue; var ObjectTID = new TypeAndID(RootObjectTypes.WorkorderService, c.ID); - - + + dynamic d = new JObject(); //d.concurrencyToken = util.CTokenFromResponse(rMainObject); progress.Op(ObjectTypeName + " " + c.WorkorderService.ServiceNumber); @@ -1379,19 +1399,20 @@ namespace AyaNova.PlugIn.V8 Tagit(c.RegionID, tags); SetTags(d, tags); - - + + var rMainObject = await util.PostAsync(RavenRouteName, d.ToString()); long RavenId = util.IdFromResponse(rMainObject); AddMap(c.ID, RavenId); d = rMainObject.ObjectResponse["data"]; d.serial = c.WorkorderService.ServiceNumber; + d.notes = c.Summary; //Attachments / FILES await ExportAttachments(ObjectTID, progress, util.AyaType.WorkOrder); //----- - + // wiki if (WikiPage.HasWiki(c.ID)) {