Filter.Add

Syntax:

Add(<Description>, <Name>, <Representation>)

Parameters:

<Description> (required)

Type: String.
Description of the filter element as the name of an available field or as a full path.
For example, "Counteragent.Code", in which "Counteragent" is one of the fields available for filtering.

<Name> (optional)

Type: String.
Filter item name. If the parameter is not specified, the name is set automatically using the description that has been passed as the first parameter.

<Representation> (optional)

Type: String.
User representation of the added filter element.

Returned value:

Type: FilterItem; Undefined.
If it is impossible to add a filter element, Undefined value is returned.

Description:

It adds a filter element as a path based on a provided field description.
For example, if the "Counteragent" field is available, you can use "Counteragent", "Counteragent.CounteragentType", "Counteragent.CounteragentType.Description", etc. as filter elements.
Caution: This method is not available for filtering dynamic lists (Filter property of CatalogList., DocumentList. and other objects).

Availability:

Server, thick client, external connection, Mobile application (server).

Note:

You can only add filtering elements belonging to the collection of available fields.

Example:

Filter = BalanceReport.ReportBuilder.Filter;
If 
Filter.Find("Nomenclature") = Undefined Then
    Filter.Add("Nomenclature");
EndIf
;
Filter["Nomenclature"].Use = True;
Filter["Nomenclature"].Value      = Nomenclature;
Filter["Nomenclature"].ComparisonType  = 
        ?(Nomenclature.IsFolder, 
            ComparisonType.InListByHierarchy, 
            ComparisonType.Equal);

See also:

Filter, method SetAvailableFields

    

1C:Enterprise Developer's Community