Объявление

Свернуть
Пока нет объявлений.

Filter combine

Свернуть
X
  • Фильтр
  • Время
  • Показать
Очистить всё
новые сообщения

  • Filter combine

    Hello,
    my first posting in the Forum but i think more will come
    hope i can get some help here.

    i have to build a filter in a Loop (for each...) - so the filter gets bigger
    so i thought Combine would be the way.

    for each objOERequest In objOERequests
    'do some checks - if checks are OK append this OrganisationUnit to the filter
    objV02FilterSingle.userfield("Z01_V02_OrgEinheit") = objOERequest
    objV02FilterSingle.UserFieldComparison("Z01_V02_Or gEinheit") = 1
    If V02first_filter = "X" Then
    V02first_filter = ""
    set objV02FilterAll = objV02FilterSingle
    Else
    objV02FilterAll.combine objV02FilterSingle, 2
    End If
    Next
    set objV02Requests = objV02Folder.Search(objV02FilterAll, False)

    but the result is only one filter-criteria not more

    thanks for your replies
    Helmut

  • #2
    Hello,

    try this -
    Код:
    Dim objFilter : Set objFilter = objV02Folder.MakeFilter
    Dim objFilterTmp : Set objFilterTmp = objV02Folder.MakeFilter
    Dim blnFirstRun : blnFirstRun = True
    for each objOERequest In objOERequests
      If blnFirstRun Then
        'do some checks - if checks are OK append this OrganisationUnit to the filter
        objFilter.userfield("Z01_V02_OrgEinheit") = objOERequest
        objFilter.UserFieldComparison("Z01_V02_OrgEinheit") = 1
        blnFirstRun = False
      Else
        objFilterTmp.Clear
        'do some checks - if checks are OK append this OrganisationUnit to the filter
        objFilterTmp.userfield("Z01_V02_OrgEinheit") = objOERequest
        objFilterTmp.UserFieldComparison("Z01_V02_OrgEinheit") = 1
        objFilter.Combine objFilterTmp, 2 ' OR
      End If
    Next
    
    LogMessage objFilter.Rule.AsString
    set objV02Requests = objV02Folder.Search(objFilter, False)
    С уважением, Сергей Осадчий

    Комментарий


    • #3
      Thank you very much für your quick and really good help
      tried it out yesterday and it works

      Комментарий

      Обработка...
      X