Lately, in my error log, I am receiving this error:
Error generating email messages for template 'Order Shipped' having subject 'Your order has shipped from PoolGeek.com'.
Here is the debug data:
Invocation of method 'ToString' in CommerceBuilder.Common.LSDecimal threw exception System.NullReferenceException : Object reference not set to an instance of an object.; Object reference not set to an instance of an object
I have a set of automated tasks that sort through pending orders, and adjust the statuses. I'm assuming that this error is happening when an order shipment has the .Ship() method called, or when I update the order status to complete, which will fire off the 'Order Shipped' email. The problem is, I am getting tons of these errors in the log, but all the customers seem to be getting the messages.
Any idea of what I could do to get to the bottom of this problem? Here is a snippet from my Automation class that refers to the shipping and status updates...
Code: Select all
Boolean allshipped = true;
if (_Order.Shipments != null && _Order.Shipments.Count > 1)
{
foreach (OrderShipment os in _Order.Shipments)
{
if (!os.IsShipped)
allshipped = false;
}
}
_Order.Shipments[ShipNum].Ship();
_Order.Shipments[ShipNum].ShipMessage = si.FilledBy;
_Order.Shipments[ShipNum].Save();
_Order.Save();
if (allshipped)
_Order.UpdateOrderStatus(3);
else
_Order.UpdateOrderStatus(13);
_Order.Save();
Scott