origam.com

Error Incorrect syntax near ')'

I got error Incorrect syntax near ')' after upgrading to latest stable 2022.1.0.2519 on one master-detail form when clicking on different master records. Probably the SQL syntax is not correctly created to reload data in detail part.
image

2022-04-26 15:43:39,861 [25] ERROR Origam.DA.Service.DataLoader - Incorrect syntax near ')'., SQL: SELECT  [TTD_DumpFarmerTotal].[LastContractDate] AS [LastContractDate], [TTD_DumpFarmerTotal].[refTTD_LineId] AS [refTTD_LineId], ([TTD_DumpFarmerTotal].[LastReportWeight] - [TTD_DumpFarmerTotal].[DeliveredSinceLastReport]) AS [CurrentWeight], [TTD_DumpFarmerTotal].[LastContractWeight] AS [LastContractWeight], [TTD_DumpFarmerTotal].[refProjectId] AS [refProjectId], [TTD_DumpFarmerTotal].[NextContractWeight] AS [NextContractWeight], [TTD_DumpFarmerTotal].[LastReportWeight] AS [LastReportWeight], [TTD_DumpFarmerTotal].[refTTD_DumpId] AS [refTTD_DumpId], [TTD_DumpFarmerTotal].[LastReportDate] AS [LastReportDate], [TTD_DumpFarmerTotal].[NextContractDate] AS [NextContractDate], [TTD_DumpFarmerTotal].[refTTD_ProjectDumpId] AS [refTTD_ProjectDumpId], [TTD_DumpFarmerTotal].[DeliveredSinceLastReport] AS [DeliveredSinceLastReport], [TTD_DumpFarmerTotal].[refFarmerBusinessPartnerId] AS [refFarmerBusinessPartnerId], [TTD_DumpFarmerTotal].[refTTD_DumpReportTypeId] AS [refTTD_DumpReportTypeId], [TTD_DumpFarmerTotal].[refTTD_SeasonId] AS [refTTD_SeasonId] FROM [TTD_DumpFarmerTotal] AS [TTD_DumpFarmerTotal]  WHERE ()
System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near ')'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
   at System.Data.SqlClient.SqlDataReader.get_MetaData()
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
   at Origam.DA.Service.DataLoader.Fill() in D:\a\1\s\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 150
ClientConnectionId:82b07aaf-ccab-4aa8-9bb1-8aabe16c7d8d
Error Number:102,State:1,Class:15

We need a model in order to debug the SQL generation.

And it is also important that both server and Architect are upgraded to the same version.

Model was sent via private channel. Server and architect are both on same version.

Entity has primery key on Detached item. Screen is lazy loaded. Error raises when system tries load RowStates.
During this process system tries load specific rows by primary key from database.
This action will never be finished, because primary key is on detached item and not on FieldMappingItem .

Improve information about this issue.