From 96a1c27c4427de14904d7d359f90a8871ccdfa51 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 20 Aug 2021 17:11:53 +0000 Subject: [PATCH] --- source/Plugins/AyaNova.Plugin.V8/V8.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/source/Plugins/AyaNova.Plugin.V8/V8.cs b/source/Plugins/AyaNova.Plugin.V8/V8.cs index 9c40a49..507f661 100644 --- a/source/Plugins/AyaNova.Plugin.V8/V8.cs +++ b/source/Plugins/AyaNova.Plugin.V8/V8.cs @@ -235,8 +235,13 @@ namespace AyaNova.PlugIn.V8 private async System.Threading.Tasks.Task CreateSubstitute(Guid id, RootObjectTypes desiredType) { //create the simplest possible version of this object desired + dynamic d = new JObject(); + string sName = MissingDataNamePrefix + " " + id.ToString(); + d.name = sName;//usually this will suffice, for the rare cases it doesn't add to the correct property below, the name property will be ignored if it's not applicable + string route = ""; switch (desiredType) { + //set route and make dynamic object case RootObjectTypes.Part: { @@ -249,12 +254,18 @@ namespace AyaNova.PlugIn.V8 break; case RootObjectTypes.Client: { + route = "customer"; } break; default: throw new Exception("Error: CreateSubstitute (source id: " + id.ToString() + " for type: " + desiredType.ToString() + ") THIS TYPE NOT CODED YET"); } + + //post route and dynamic object, insert into map and return + var rMainObject = await util.PostAsync("customer", d.ToString(Formatting.None));//test formatting none, if works then propogate everywhere + long RavenId = util.IdFromResponse(rMainObject); + Addv7v8IdMap(id, RavenId); } @@ -294,7 +305,7 @@ namespace AyaNova.PlugIn.V8 private bool V7UseInventory = false; private List Allv8WarehouseIds = new List(); - + @@ -3157,7 +3168,7 @@ namespace AyaNova.PlugIn.V8 dwipr.workOrderItemId = ravenwoitemid; dwipr.quantity = wipr.Quantity; dwipr.partId = await Getv7v8IdMap(wipr.PartID, RootObjectTypes.Part); - + dwipr.partWarehouseId = await Getv7v8IdMap(wipr.PartWarehouseID, RootObjectTypes.PartWarehouse); poitemtowoitempartrequest pto = PoItemPartRequestMap.FirstOrDefault(z => z.v7woitempartrequestid == wipr.ID);