This commit is contained in:
2021-08-26 00:39:15 +00:00
parent e897940971
commit d991371595

View File

@@ -530,11 +530,13 @@ namespace AyaNova.PlugIn.V8
progress.Append("inner stack:\r\n" + ExceptionDuringMigrate.InnerException.StackTrace);
}
}
progress.FinishedImport();//just enables close / cancel etc
progress.Op("Saving export log to v8 memo for SuperUser...");
await PostExportLogToV8(progress);
progress.Append("\r\n************\r\nLog and help links saved in v8 Memo to SuperUser account (Home->Memos)");
progress.FinishedImport();
progress.Append("Export completed");
progress.Op("");
@@ -4273,12 +4275,7 @@ namespace AyaNova.PlugIn.V8
AddImportTag(tags);
dynamic d = new JObject();
//It's a Review / followup tied to another object that should have already been migrated
if (!V7ToV8IdMap.ContainsKey(c.FollowID))
{
progress.Append("FollowUp target missing; skipping export: ID " + c.ID.ToString() + ",targetid " + c.FollowID.ToString() + ",type " + c.FollowType.ToString());
continue;
}
//export
//FollowUps only ever apply to a single user in v7 so no need to split them out here it's just for one user
@@ -4331,7 +4328,7 @@ namespace AyaNova.PlugIn.V8
v8FollowId = await Getv7v8IdMapNullOk(c.FollowID, RootObjectTypes.Workorder, false, true);
if (v8FollowId == null)
{
progress.SubOp("Follow up for WO skipped due to WO non-existance");
progress.Append("Follow up for WO skipped due to WO non-existance");
continue;
}
d.objectId = v8FollowId;
@@ -4340,19 +4337,21 @@ namespace AyaNova.PlugIn.V8
break;
case RootObjectTypes.WorkorderQuote:
{
Guid woid=Guid.Empty;
try
{
Workorder o = Workorder.GetWorkorderByRelativeNoMRU(RootObjectTypes.WorkorderQuote, c.FollowID);
woid=o.ID;
}
catch (FetchException ex)
{
progress.SubOp("Follow up for quote skipped due to quote non-existance");
progress.Append("Follow up for quote skipped due to quote non-existance");
continue;
}
v8FollowId = await Getv7v8IdMapNullOk(c.FollowID, RootObjectTypes.Workorder, false, true);
v8FollowId = await Getv7v8IdMapNullOk(woid, RootObjectTypes.Workorder, false, true);
if (v8FollowId == null)
{
progress.SubOp("Follow up for quote skipped due to quote non-existance");
progress.Append("Follow up for quote skipped due to quote non-existance");
continue;
}
d.objectId = v8FollowId;
@@ -4361,20 +4360,21 @@ namespace AyaNova.PlugIn.V8
break;
case RootObjectTypes.WorkorderPreventiveMaintenance:
{
// Workorder o = Workorder.GetWorkorderByRelativeNoMRU(RootObjectTypes.WorkorderPreventiveMaintenance, c.FollowID);
Guid woid = Guid.Empty;
try
{
Workorder o = Workorder.GetWorkorderByRelativeNoMRU(RootObjectTypes.WorkorderPreventiveMaintenance, c.FollowID);
woid = o.ID;
}
catch (FetchException ex)
{
progress.SubOp("Follow up for PM skipped due to PM non-existance");
progress.Append("Follow up for PM skipped due to PM non-existance");
continue;
}
v8FollowId = await Getv7v8IdMapNullOk(c.FollowID, RootObjectTypes.Workorder, false, true);
v8FollowId = await Getv7v8IdMapNullOk(woid, RootObjectTypes.Workorder, false, true);
if (v8FollowId == null)
{
progress.SubOp("Follow up for PM skipped due to PM non-existance");
progress.Append("Follow up for PM skipped due to PM non-existance");
continue;
}
d.objectId = v8FollowId;
@@ -4383,7 +4383,12 @@ namespace AyaNova.PlugIn.V8
break;
default:
{
//It's a Review / followup tied to another object that should have already been migrated
if (!V7ToV8IdMap.ContainsKey(c.FollowID))
{
progress.Append("FollowUp target missing; skipping export: ID " + c.ID.ToString() + ", targetid " + c.FollowID.ToString() + ",type " + c.FollowType.ToString());
continue;
}
d.objectId = V7ToV8IdMap[c.FollowID];
d.objectType = util.RootObjectToAyaType(c.FollowType);
}