Record Filter ??

navuser1navuser1 Member Posts: 1,329
Hi All,

Plaese Share your knowledge.....


Suppose I have report - Sales Document.
This report is based on two tables 1.Sales Header and 2.Sales Line (is indented).
There are two RequestFilterFields on The Sales Haeder one is Posting Date and another
is Location Code.

If I set the fiter as below

Posting : 010407..300407|290607
Location Code : WHITE|GREEN
Then How can I apply the same filter on the Other Table (Purchase Header, Posting date :=010407..300407|290607 and Location Code :=WHITE|GREEN)

Is it possioble in the Trigger OnPreReport of Report??

Plz reply.
Now or Never

Comments

  • MBergerMBerger Member Posts: 413
    Because you say you indented the salesline dataitem, i guess you want to see the lines of the header you selected with your filter, so you probably do NOT want to apply that filter to the lines too !

    i don't think you need to set any other filter than a standard
    Salesline."Document type" = Salesheader."document type"
    Salesline."Document No." = SalesHeader."No."

    but to answer your question, it IS possible to set filter in your OnPreDataItem trigger.
  • kapamaroukapamarou Member Posts: 1,152
    Yes you can by using GETFILTER.


    MyFilter := rec.GETFILTER(field);

    rec2.SETFILTER(field,MyFilter);


    Read the help about this.
  • navuser1navuser1 Member Posts: 1,329
    kapamarou wrote:
    Yes you can by using GETFILTER.


    MyFilter := rec.GETFILTER(field);

    rec2.SETFILTER(field,MyFilter);


    Read the help about this.

    Dear kapamarou

    IF Myfilter is 010407..300407|300707 THEN
    Will rec2.SETFILTER(field,MyFilter) work ??
    Now or Never
  • kapamaroukapamarou Member Posts: 1,152
    Yes it will... You'll have to do some debugging in order to see what values are passed into your text variable, but if it is filled then applying it as a filter will work...

    Have you tried it?

    Since you are referring to a report, if you are having problems with this then it might be the place you read the filters.

    If you use a text variable to store the filters i.e. MyDateFilter then go to the OnPreReport and do
    MyDateFilter := "Sales Header".GETFILTER("Posting Date");
    

    Then go to OnPreDataItem of Purchase Header and Do
    SETFILTER("Posting Date",MyDateFilter);
    
  • David_SingletonDavid_Singleton Member Posts: 5,479
    navuser1 wrote:
    Suppose I have report - Sales Document.
    This report is based on two tables 1.Sales Header and 2.Sales Line (is indented).
    There are two RequestFilterFields on The Sales Haeder one is Posting Date and another
    is Location Code.
    navuser1 wrote:
    Then How can I apply the same filter on the Other Table (Purchase Header, Posting date :=010407..300407|290607 and Location Code :=WHITE|GREEN)

    Sales or Purchase header?
    David Singleton
Sign In or Register to comment.