I am basically trying to clone an order. However, the call to ApplyChanges throws an exception.
In the catch handler, I break on the call to GetMessages() and interrogate the result via the msgs variable. There is only one entry in the Messages list. In the Immediate Window I see the following:
msgs.First()
{SoftPro.OrderTracking.Client.Orders.OrderBase<Order>.OrderModuleErrorMessage}
Item: {Order TS20180323085024}
Property: null
Text: "There are outstanding order module compilation errors."
I am not familiar with this error, nor do I know how to identify or dig into the compilation errors mentioned in the message. Help appreciated. Thanks.
Code: Select all
// IOrderStore os passed in to this method...
//Create an order number, and specify a template to overlay, as well as another order to overlay
OrderCreationSpec spec = new OrderCreationSpec();
spec.BaseNumber = DateTime.Now.ToString("TSyyyyMMddHHmmss");
spec.Templates.Add("201800341AL");
IOrder order = null;
try
{
order = os.NewOrder(spec);
// Save the order in the database.
os.ApplyChanges(order); // <<-- This line throws the OperationCanceledException
}
catch (Exception ex)
{
Console.WriteLine($"Exception: ({ex.Message}) ");
var msgs = order.GetMessages();
Console.WriteLine($"Num errors: ({msgs.Count()}) ");
}
return order;