ShipMethodDataSource.LoadForShipment() Fails

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
moustafa
Lieutenant (LT)
Lieutenant (LT)
Posts: 54
Joined: Wed Oct 19, 2011 9:54 pm

ShipMethodDataSource.LoadForShipment() Fails

Post by moustafa » Fri Jun 14, 2013 1:48 am

When attempting to assign a new shipping method to an order in the administrative interface, we get the following error for some (not all) orders:
Object reference not set to an instance of an object

When debugging, I found that the problem was with the ShipMethodDataSource.LoadForShipment(shipment) method being invoked in EditShipmentsGrid_ItemCommand() which is found in /Admin/Orders/Shipments/Default.aspx.cs.

I am passing it a valid shipment. The proof of this is that shipment.ShipMethodName is valid. Furthermore, calling method.GetShipRateQuote(shipment) on any method returned by ShipMethodDataSource.LoadForStore() works. It's only LoadForShipment() that doesn't work.

Any ideas why this might be happening?

Since this is an administrative page, I implemented a workaround which was to use all the shipping methods returned by LoadForStore() instead of only those available for this particular order. However, why is this happening?

Thanks,
Moustafa

Post Reply