report filter problem

mkpjsrmkpjsr Member Posts: 587
Hi all,

I have designed a report to show the details of sales using "Sales Invoice Header" and "Sales Invoice Line" table [Report contains fields from these two tables]. Now i want to filter this report to show details of only those invoice nos. (No. field of Sales Invoice Header table) that is not present in the "Applies-to Doc. No" field of the "Sales Cr.Memo Header" table.

so i have written the following code to filter the report:
SalesInvHeader.SETFILTER("No.",'<>%1',SalesCreditMemoHeader."Applies-to Doc. No.");

i have tried using this code under
Sales Invoice Header - OnPreDataItem()
and
Sales Invoice Header - OnAfterGetRecord()

but its not working,
what is wrong with the code , can anybody suggest me.

Answers

  • vijay_gvijay_g Member Posts: 884
    Try this..
    Sales Invoice Header - OnAfterGetRecord()
    SalesCreditMemoHeader.reset;
    SalesCreditMemoHeader.SETRANGE(SalesCreditMemoHeader."Applies-to Doc. No.","No.");
    IF SalesCreditMemoHeader.FINDFIRST THEN 
       CURRREPORT.SKIP;
    
  • mkpjsrmkpjsr Member Posts: 587
    vijay_g wrote:
    Try this..
    Sales Invoice Header - OnAfterGetRecord()
    SalesCreditMemoHeader.reset;
    SalesCreditMemoHeader.SETRANGE(SalesCreditMemoHeader."Applies-to Doc. No.","No.");
    IF SalesCreditMemoHeader.FINDFIRST THEN 
       CURRREPORT.SKIP;
    

    thanx, its working
Sign In or Register to comment.