Pass list from server to client problem

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

Hello!

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: {http://v8.1c.ru/8.2/managed-application/modules}ret
because:
Error converting XDTO data:
Property value record 'value':
form: Item
name: {http://v8.1c.ru/8.1/data/core}value
because:
XDTO type mapping on V8 type is missing:
Missing view for type 'QueryResultSelection'


If anyone can explain whant's wrong?

 
#2
People who like this:0Yes/0No
Active user
Rating: 3
Joined: Nov 1, 2011
Company:

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;

 
#3
People who like this:0Yes/0No
Active user
Rating: 4
Joined: Sep 16, 2011
Company: Oksley Shipping

Yep, that helped! Thank you, Alexey!

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.