I’ve an integration that uses a custom order field to show a ERP message to the end user. The field is being correctly updated in the Dynamicweb database but in the template the tag generated does not match the value in the database. To have the custom field correctly saved in database I use the Save method of the order.
I’ve tried to use API to load the order from the database and the result is also the same, does not show the saved value in database.
var orders = Dynamicweb.eCommerce.Orders.Order.GetOrders(string.Format("select * from ecomorders where orderid = '{0}'", GetString("Ecom:Order.ID")));
var order = orders[0];
<p>@order.OrderFieldValues.First(x => x.OrderField.SystemName.Equals("OrderVoucherNotification")).Value</p>
Or even like this:
var order = Dynamicweb.eCommerce.Orders.Order.GetOrderByID(GetString("Ecom:Order.ID"));
<p>@order.OrderFieldValues.First(x => x.OrderField.SystemName.Equals("OrderVoucherNotification")).Value</p>
Are the order custom fields cached in somewhere and not being correctly updated when the integration changes the values?
Thanks,
Rui Silva