Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Filter for Tabular Sections / ValueTable

Forum

Search UsersRules
Filter for Tabular Sections / ValueTable
#1
Just came
Points:: 0
Joined:: Jul 31, 2014

Hello!

How can I create a filter (e.g. that searches for a value in a specific column) for tabular sections or value tables via the 1C programming language? I know it is possible via the user interface (find or advanced search), but I need to change it dynamically in the background.

Profile
#2
Administrator
Points:: 0
Joined:: Oct 3, 2019

Hi Oliver,

yes it is possible.

Take a look at the example below:

suppose we have a document (screenshots 1 and 2).

This code sets a filter on the tabular section of this document:

Code
&AtClient
Procedure Command(Command)

   structureFilter = New Structure;
   structureFilter.Insert("Product", "Product_2");

   Items.Products.RowFilter = New FixedStructure(structureFilter);
   
EndProcedure



The result of the code in screenshot 3.

If we want to cancel the filter, then we need the following code:

Code
&AtClient
Procedure Command1(Command)

   Items.Products.RowFilter = New FixedStructure();
   
EndProcedure

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.