(SETFILTER) OR (SETILTER) possible ?

KADKAD Member Posts: 2
I would like to combine record level Filter by OR Statements, so i can get all Records that satisfy any of the following statements

SETFILTER(No.,myDocno)
OR SETFILTER(Customer Quote No.,myQuoteNo)
OR SETFILTER("Customer Order No.",myOrderNo)

if written in SQL it would look something like this:

Select From ...WHERE ("No."=?) OR ("Customer Quote No."=?") OR "Customer Order No."=?);

Is it possible without temporary tables or SQL-Views/Stored procedures ? ](*,)

Comments

  • garakgarak Member Posts: 3,263
    Yes it is possible.
    Table.SETFILTER("No.",myDocno);
    if Table.findset (Table.find('-')) then begin
      repeat
        Table.mark(true);
      until Table.next = 0;
    end;
    
    Table.setrange("No.");
    Table.SETFILTER("Customer Quote No.",myQuoteNo);
    if Table.findset (Table.find('-')) then begin
      repeat
        Table.mark(true);
      until Table.next = 0;
    end;
    
    Table.SETRange("Customer Quote No.");
    Table.SETFILTER("Customer Order No.",myOrderNo);
    if Table.findset (Table.find('-')) then begin
      repeat
        Table.mark(true);
      until Table.next = 0;
    end;
    Table.SETRange("Customer Order No.");
    Table.markedonly(true);
    form.runmodal(Form::XYZ,Table);
    

    @ALL
    I've got the feeling, that the SQL not like mark. (Performance)

    Regards
    Garak
    Do you make it right, it works too!
  • kinekine Member Posts: 12,562
    Search the forum, many posts about OR between fields filters... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.