Developer forum

Forum » Ecommerce - Standard features » Error in OrderViewSearchList.cshtml

Error in OrderViewSearchList.cshtml

Stephen Anthony Jackson
Reply

Hello.

We are integrating a Visma Business ERP with DW, and importing older orders from the ERP so the customers can see their order history.

However, when importing to the EcomOrders table, I get the following error

 

Line 89:                     string orderDate = order.CompletedDate.Value.TimeOfDay.Ticks > 0 ? order.CompletedDate.ToString() : order.CompletedDate.Value.ToString(Pageview.Area.CultureInfo.DateTimeFormat.ShortDatePattern);
 
[InvalidOperationException: Nullable object must have a value.]

I have checked all the date columns in the EcomOrder table (especially OrderCompletedDate).. there IS a value there, but still this fails. I dont get it. There must be something more missing in the import that makes the completeddata fail to calculate correctly in the backend.

Ive done a query for that order, and one that works, looking at them side-by-side, and I cannot see any relevent differences. Anyone got any clues?


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Can you try to output order.CompletedDate.HasValue in your template to see if it actually has a value?

 

You must be logged in to post in the forum