Can a Setfilter be used Like this??

tejateja Member Posts: 78
Hi Experts,

I have Table A and B
I am filtering the table A with B
Can a Setfilter be used Like this
A.Setfilter(A."No.",A.Name,A.AccntNo,'%1,%2,%3',B."No.",B.Name,B.AccntNo)

Please Clear this Doubt..

Thanks & Regards
teja

Comments

  • garakgarak Member Posts: 3,263
    NO.

    You must filter every field self.
    It's like if you filter manually on a form.

    Regards
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,305
    So your filters would be set like this:
    A.SETFILTER("No.",'=%1',B."No.");
    A.SETFILTER(Name,'=%1',B.Name);
    A.SETFILTER(AccntNo,'=%1',B.AccntNo);
    

    Or, what is a little easier, use SETRANGE:
    A.SETRANGE("No.",B."No.");
    A.SETRANGE(Name,B.Name);
    A.SETRANGE(AccntNo,B.AccntNo);
    

    If you go to the Help men, you'll find the "C/SIDE Reference Guide", and inside that you will find syntax help on all C/AL keywords. This is an excellent resource.
Sign In or Register to comment.