Desktop version

Main > Forum > 1C:Enterprise Platform > 1C:Enterprise – Business applications platform > Dynamic list Tree with folders filter

Forum

Search UsersRules
Dynamic list Tree with folders filter
#1
Interested
Points:: 15
Joined:: Oct 27, 2011

I need to create folder tree structure, but only for the folder which actually contains searched items, not the whole hierarchy. Is there any way to do it?

1. I have created Dynamic list with custom query
2. I have created Form ListTree item for that query
3. The ListTree item shows only Folders
4. I need to present only Folder Hierarchy for the items which represent query result with LIKE condition.

Code
QueryText = "SELECT
            |   Nomenclatura.Ref AS Ref,
            |   Nomenclatura.IsFolder AS IsFolder,
            |   Nomenclatura.Description
            |FROM
            |   Catalog.Nomenclatura AS Nomenclatura
            |WHERE
            |   Nomenclatura.Description LIKE &SearchString";

Profile
#2
Interested
Points:: 0
Joined:: Dec 4, 2017

Dear Alexey,

For your dynamic list, you can include the IsFolder = True filter like in the attached screenshot.



Best regards,
Vladimir Gurov

Profile
#3
Interested
Points:: 15
Joined:: Oct 27, 2011

Ok, I think I was not clear enough

Imagine that you have a huge list of items and categories. You are searching for something special (items). There are 2 coincidence in names of items searched and they are in 2 different categories (groups). So I need to show categories from the path to the item and not all the categories.

For example I have 100 categories and only in 2 items were found by the item description. So I need to present hierarchically the path to those items.
root -> cat B -> item1
root -> cat GH -> SubCat AZ -> item2
in form of a tree. Items should be excluded from the presentation.

The tree should not include any other categories(groups) if there is no items found down the hierarchy.

Profile
#4
Interested
Points:: 0
Joined:: Dec 4, 2017

Dear Alexey,

With the new details you specified, you task becomes more complicated.

If your task is strictly bound to a dynamic list, you will not be able to solve it with the query language only.

For instance, you can additionally use a register with a string or Ref dimension for the full path to an item in the catalog and a resource for the item's path representation in the desirable format. First, you populate the register with the catalog item data and then you retrieve the data to the dynamic list according to the register via the left join in the query. The key point to consider is the way you update the register with the changes in the catalog items (for instance, upon the event of posting changes to the catalog).


Alternatively, instead of the dynamic list, you can use the data composition system (DCS) report. With DCS, you can create your custom function that processes the query results in the way you need.

Best regards,
Vladimir Gurov

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.