Developer forum

Forum » Development » Setting OrderState

Setting OrderState


Reply

I found the solution, wrong database :)

 

I have this simple code:

 

 

 

Order myOrder = new Order(str);"OS5";

myOrder.StateID =

myOrder.Save();

 

It returns a error:System.Data.SqlClient.SqlException: The UPDATE statement conflicted with the FOREIGN KEY constraint "EcomOrders$EcomOrderStatesEcomOrders". The conflict occurred in database "eCom", table "dbo.EcomOrderStates", column 'OrderStateID'.
The statement has been terminated

 

What I wrong?

 

Dynamicweb.eCommerce.Orders.


Replies

 
Reply

Do you find OS5 in EcomOrderStates?

 
Reply
Sorensen wrote:

Do you find OS5 in EcomOrderStates?


 

Yes, it is a default installation so it contains OS1 to OS10 in the EcomrderStates and I can set it directly in the db.

 

You must be logged in to post in the forum