I am trying to pass some data from client to server for processing it at client, here is my code:
Code
&AtClient
Procedure Show(Command)
List = GetList();
For Each Row In List Do
Message(Row.Counterparty.Presentation() + ": " + Row.Amount);
EndDo;
EndProcedure
&AtServer
Function GetList()
Query = New Query;
Query.Text = "SELECT
| SUM(MutualSettlementsBalance.AmountBalance) AS Amount,
| MutualSettlementsBalance.Counterparty AS Counterparty
|FROM
| AccumulationRegister.MutualSettlements.Balance(&Period, ) AS MutualSettlementsBalance
|
|GROUP BY
| MutualSettlementsBalance.Counterparty";
Query.SetParameter("Period", Period);
QueryResult = Query.Execute();
SelectionDetailRecords = QueryResult.Choose();
List = New ValueList;
While SelectionDetailRecords.Next() Do
List.Add(SelectionDetailRecords);
EndDo;
Return List;
EndFunction
But receive the following error when execute Show command:
{DataProcessor.MutualSettlementsReport.Form.Form.Form(47)}: Error calling context method (GetList) List = GetList(); because: Data transfer between client and server error. Invalid value type. because: Error converting XDTO data: Property value record 'ret': form: Item name: {}ret because: Error converting XDTO data: Property value record 'value': form: Item name: {}value because: XDTO type mapping on V8 type is missing: Missing view for type 'QueryResultSelection'
You cant transfer such kind of data betwin server and client. Try this code:
Code
List = New ValueList;
While SelectionDetailRecords.Next() Do
RecordStructure = New Structure("Amount,Counterparty ");
FillPropertyValues(RecordStructure ,SelectionDetailRecords);
List.Add(RecordStructure );
EndDo;