Developer forum

Forum » Ecommerce - Standard features » Sorting Favorite lists renders error

Sorting Favorite lists renders error

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I have a solution running on 9.13.7.

After the upgrade, we are seeing an error when sorting the products inside a favorite list:

Designs/Rapido/Json/eCom/CustomerCenter/SaveSortingEndpoint.cshtml"
System.InvalidOperationException: Dynamic SQL generation for the UpdateCommand is not supported against a SelectCommand that does not return any key column information.
   at System.Data.Common.DbDataAdapter.UpdatingRowStatusErrors(RowUpdatingEventArgs rowUpdatedEvent, DataRow dataRow)
   at System.Data.Common.DbDataAdapter.Update(DataRow[] dataRows, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.UpdateFromDataTable(DataTable dataTable, DataTableMapping tableMapping)
   at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
   at Dynamicweb.Data.DataManager.Update(DataSet dataSet, Boolean acceptChangesDuringFill)
   at Dynamicweb.Data.DbObject.Save()
   at Dynamicweb.Ecommerce.CustomerCenter.CustomerProductListProduct.Save()
   at CompiledRazorTemplates.Dynamic.RazorEngine_60001307cdcd42719e8bd93858a49424.Execute() in D:\dynamicweb.net\Solutions\Degree\kraemer.cloud.dynamicweb-cms.com\Files\Templates\Designs\Rapido\Json\eCom\CustomerCenter\SaveSortingEndpoint.cshtml:line 27


Anybody has any idea why? And how it can be fixed?

Thank you,
Adrian


Replies

 
Oleg Rodionov Dynamicweb Employee
Oleg Rodionov
Reply

Hi Adrian,

As I understand, the issue is reproduced on solution based on DW9.13.7. Appropriate key for EcomCustomerFavoriteProducts table seems not to have been added (probably, you have faults on saving a list even in backend as well now.) So, ensure that ecom upgrade script for package 2235 has been done correctly (see upgrade log) or try to perform the request:

ALTER TABLE [dbo].[EcomCustomerFavoriteProducts] ADD  CONSTRAINT [DW_PK_EcomCustomerFavoriteProducts] PRIMARY KEY NONCLUSTERED 

(

    [FavoriteListId] ASC,

    [ProductId] ASC,

    [ProductVariantId] ASC

)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] 

 BR, Oleg QA

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you very much, Oleg. I will try it out.

Adrian

 

You must be logged in to post in the forum