Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I want to change status on my order.
My code
var newOrderStatus = OrderStatus.All().Single(x => x.Name == statusName); var orderService = ObjectFactory.Instance.Resolve<IOrderService>(); orderService.ChangeOrderStatus(order, newOrderStatus);
newOrderStatus, order & orderService look fine. What am I doing wrong?
I get this error:
NHibernate.PropertyValueException was unhandled by user code HResult=-2146232832 Message=not-null property references a null or transient value UCommerce.EntitiesV2.OrderStatusAudit.NewOrderStatus Source=NHibernate EntityName=UCommerce.EntitiesV2.OrderStatusAudit PropertyName=NewOrderStatus StackTrace: at NHibernate.Engine.Nullability.CheckNullability(Object[] values, IEntityPersister persister, Boolean isUpdate) at NHibernate.Event.Default.AbstractSaveEventListener.PerformSaveOrReplicate(Object entity, EntityKey key, IEntityPersister persister, Boolean useIdentityColumn, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) at NHibernate.Event.Default.AbstractSaveEventListener.SaveWithGeneratedId(Object entity, String entityName, Object anything, IEventSource source, Boolean requiresImmediateIdAccess) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.SaveWithGeneratedOrRequestedId(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.EntityIsTransient(SaveOrUpdateEvent event) at NHibernate.Event.Default.DefaultSaveOrUpdateEventListener.OnSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.FireSaveOrUpdate(SaveOrUpdateEvent event) at NHibernate.Impl.SessionImpl.SaveOrUpdate(String entityName, Object obj) at NHibernate.Engine.Cascade.CascadeToOne(Object parent, Object child, IType type, CascadeStyle style, Object anything, Boolean isCascadeDeleteEnabled) at NHibernate.Engine.Cascade.CascadeCollectionElements(Object parent, Object child, CollectionType collectionType, CascadeStyle style, IType elemType, Object anything, Boolean isCascadeDeleteEnabled) at NHibernate.Engine.Cascade.CascadeCollection(Object parent, Object child, CascadeStyle style, Object anything, CollectionType type) at NHibernate.Engine.Cascade.CascadeOn(IEntityPersister persister, Object parent, Object anything) at NHibernate.Event.Default.AbstractFlushingEventListener.CascadeOnFlush(IEventSource session, IEntityPersister persister, Object key, Object anything) at NHibernate.Event.Default.AbstractFlushingEventListener.PrepareEntityFlushes(IEventSource session) at NHibernate.Event.Default.AbstractFlushingEventListener.FlushEverythingToExecutions(FlushEvent event) at NHibernate.Event.Default.DefaultFlushEventListener.OnFlush(FlushEvent event) at NHibernate.Impl.SessionImpl.Flush() at UCommerce.Transactions.OrderService.ChangeOrderStatus(PurchaseOrder purchaseOrder, OrderStatus newOrderStatus, String userName) at Weheart.Print.ChangeOrderStatus(PurchaseOrder order, String statusName) in c:\bastard\Bastard\weheart\Print.cs:line 247 at Weheart.Print.SendOrders() in c:\bastard\Bastard\weheart\Print.cs:line 107 at Bastard.Handler.ProcessRequest(HttpContext context) in c:\bastard\Bastard\Testing.ashx.cs:line 20 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) InnerException:
Hi Henrik,
Which version of uCommerce are you running? Looking by the stack trace it seems that a property has a null-value on the OrderStatusAudit.
If you know which version you're running I can perhaps investigate it a bit further.
Best regards Martin
My version: uCommerce 6.6.2.15058
Hi again Henrik,
The new orderstatus you're trying to change to, is that a custom order status or an uCommerce built-in orderstatus?
It seems that changeOrderStatus makes a save. (I think)
So the error did not come from changeOrderStatus it self, but from when changeOrderStatus saves.
The error was in an audit I added before calling changeOrderStatus.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Error when I change order status
I want to change status on my order.
My code
newOrderStatus, order & orderService look fine. What am I doing wrong?
I get this error:
Hi Henrik,
Which version of uCommerce are you running? Looking by the stack trace it seems that a property has a null-value on the OrderStatusAudit.
If you know which version you're running I can perhaps investigate it a bit further.
Best regards Martin
My version: uCommerce 6.6.2.15058
Hi again Henrik,
The new orderstatus you're trying to change to, is that a custom order status or an uCommerce built-in orderstatus?
Best regards Martin
It seems that changeOrderStatus makes a save. (I think)
So the error did not come from changeOrderStatus it self, but from when changeOrderStatus saves.
The error was in an audit I added before calling changeOrderStatus.
is working on a reply...