Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Pass list from server to client problem

Forum

Search UsersRules
Pass list from server to client problem
#1
Active user
Points:: 0
Joined:: Sep 16, 2011

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?

Profile
#2
Active user
Points:: 0
Joined:: Nov 1, 2011

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;

Profile
#3
Active user
Points:: 0
Joined:: Sep 16, 2011

Yep, that helped! Thank you, Alexey!

Profile
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)



© 1C LLC. All rights reserved
1C Company respects the privacy of our customers and visitors
to our Web-site.