The 1C:Enterprise developers forum

#1
People who like this: 0 Yes / 0 No
Just came
Rating: 0
Joined: Feb 28, 2012
Company: Valmax Solutions Inc.

Good afternoon.

Our client gets this error when he tries to select an employee in the form field (attribute type is Catalog.Employees).
There is one choice parameter (Filter.DeletionMark=False) added to the form item.
There is also custom ChoiceDataGetProcessing event handler in the catalog Employees.

Platform version is 8.2.15.301

The source code:

Code
Procedure ChoiceDataGetProcessing(ChoiceData, Parameters, StandardProcessing)
   
   StandardProcessing = False;
   ChoiceData = New ValueList;
   
   Query = New Query;
   Query.Text = 
   "SELECT TOP 50
   |   Employees.Ref,
   |   Employees.Description + "" ("" + Employees.Code + "")"" AS Presentation
   |FROM
   |   Catalog.Employees AS Employees
   |WHERE
   |   (Employees.Description LIKE &Param
   |         OR Employees.Code LIKE &Param)";
   
   Query.SetParameter("Param", "%" + Parameters.SearchString + "%");
   
   CommonUse.AddFiltersToCustomChoiceDataGetProcessing(Parameters, Query, "Employees");
   
   Query.Text = Query.Text + "
   |
   |ORDER BY
   |   Employees.Code";
   
   Result = Query.Execute();
   
   SelectionDetailRecords = Result.Choose();
   
   While SelectionDetailRecords.Next() Do
      ChoiceData.Add(SelectionDetailRecords.Ref, SelectionDetailRecords.Presentation);
   EndDo;
   
EndProcedure

// This procedure is located in common server module
Procedure AddFiltersToCustomChoiceDataGetProcessing(Parameters, Query, CatalogName) Export
   
   If TypeOf(Parameters) = Type("Structure") Then
      If Parameters.Property("Filter") Then
         For Each AttributeName In Metadata.Catalogs[CatalogName].Attributes Do
            If Parameters.Filter.Property(AttributeName.Name) Then
               Query.Text = Query.Text + " AND " + CatalogName + "." + AttributeName.Name 
                  + " = &" + AttributeName.Name;
               Query.SetParameter(AttributeName.Name, Parameters.Filter[AttributeName.Name]);
            EndIf;
         EndDo;
         For Each AttributeName In Metadata.Catalogs[CatalogName].StandardAttributes Do
            If Parameters.Filter.Property(AttributeName.Name) Then
               Query.Text = Query.Text + " AND " + CatalogName + "." + AttributeName.Name 
                  + " = &" + AttributeName.Name;
               Query.SetParameter(AttributeName.Name, Parameters.Filter[AttributeName.Name]);
            EndIf;
         EndDo;
      EndIf;
   EndIf;
   
EndProcedure


This error never occured on my computer, and on computers of my partners.
This morning I tried to simulate it at client's computer but the system worked fine. (Client rebooted the PC before I entered the db).

Thank you for your help.
Roman.

Edited: rommario - Feb 12, 2013 11:05 PM
 
#2
People who like this: 0 Yes / 0 No
Timofey Bugaevsky
Guest

Joined:
Company:

Hello!

Please update 1C:Enterprise platform to the latest version: 8.2.17.157 is the latest version for today.
To understand the problem it should be reproduced, if it will repeat again, try to get enough information from your client to reproduce this error.

 
#3
People who like this: 0 Yes / 0 No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

Looks like it tries to pass Query object to client. Different versions of 1c have a slightly different behavior how to handle function declaration without explicitly declare &AtServer or &AtClient. I have also noticed some problems without specifying where the function should run.

 
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.

/* Агрессивный фикс заголовков для документации */ body .content h3, body #content h3, body .workarea h3, body .content h4, body #content h4, body .workarea h4, body .content h5, body #content h5, body .workarea h5 { display: block !important; color: #222 !important; font-weight: bold !important; text-transform: none !important; letter-spacing: normal !important; margin-top: 25px !important; margin-bottom: 12px !important; line-height: 1.3 !important; } /* Принудительные размеры */ body .content h3, body #content h3, body .workarea h3 { font-size: 22px !important; } body .content h4, body #content h4, body .workarea h4 { font-size: 19px !important; } body .content h5, body #content h5, body .workarea h5 { font-size: 17px !important; } /* Убираем возможные мелкие шрифты, которые могли прийти из стилей Bitrix */ .content h4 *, #content h4 *, .workarea h4 * { font-size: inherit !important; }