reports with navigate function

surisuri Member Posts: 123
A report that shows list of various entries created in various tables for a given Document No.( Like the Navigate function Shows)

in forms we have navigate
in that if we have two fields
i.e...documentno and date function
if we enter document no and date function ...then the related tables and no of records available in that we will get

if i want to do same functionality in reports ...
what data item we have to take?
what code units we have to take?
what temporary records we have to take?
where we have to write the code?

can any one have any idea regarding this ....can any one give suggestion please...
thank you

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
    Check the Sourcetable of Navigate form.

    CHeck how it is working and implement same logic in report..
  • surisuri Member Posts: 123
    in that we have document entry as a source table
    i have taken data item as document entry
    in that we have so many temporary records,codeunits are available...
    i have taken those all in reports

    but one thing here
    in forms they kept tab control..inside that they kept document no and posting date
    in below they have taken table box ..

    coming to reports is it possible
    if we enter document no and posting date then it must show the no of records available in the table....

    or else we have to take any dialog box in reports ..and enter the document no and posting date,then it wil shows the no of records available in the table..
    here i am getting confusion,in sections part what i have to take....
    can you suggest me please
    thank you
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    add document no and posting date in Request form of report.

    Add the fields in table box to sections.

    Check the code under OnPush trigger of the Find..
    You need to use the same code..
  • surisuri Member Posts: 123
    ok mohana thanks for giving reply..i will check it and i will come back to you
  • surisuri Member Posts: 123
    what you told ,i have done with that
    in request form ,i have taken
    document no and posting date......
    i have taken all the codeunits,records as we ll as functions
    i have written this code in FindRecords()
    as shown below,what the on push trigger find consists of


    Window.OPEN(Text002);
    //RESET;
    SalesShptHeader.RESET;
    //DELETEALL;
    SalesShptHeader.DELETEALL;
    //"Entry No." := 0;
    IF SalesShptHeader.READPERMISSION THEN BEGIN
    SalesShptHeader.RESET;
    SalesShptHeader.SETFILTER("No.",DocNoFilter);
    SalesShptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Sales Shipment Header",0,Text005,SalesShptHeader.COUNT);
    END;
    IF SalesInvHeader.READPERMISSION THEN BEGIN
    SalesInvHeader.RESET;
    SalesInvHeader.SETFILTER("No.",DocNoFilter);
    SalesInvHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Sales Invoice Header",0,Text003,SalesInvHeader.COUNT);
    END;
    IF ReturnRcptHeader.READPERMISSION THEN BEGIN
    ReturnRcptHeader.RESET;
    ReturnRcptHeader.SETFILTER("No.",DocNoFilter);
    ReturnRcptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Return Receipt Header",0,Text017,ReturnRcptHeader.COUNT);
    END;
    IF SalesCrMemoHeader.READPERMISSION THEN BEGIN
    SalesCrMemoHeader.RESET;
    SalesCrMemoHeader.SETFILTER("No.",DocNoFilter);
    SalesCrMemoHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Sales Cr.Memo Header",0,Text004,SalesCrMemoHeader.COUNT);
    END;
    IF ServShptHeader.READPERMISSION THEN BEGIN
    ServShptHeader.RESET;
    ServShptHeader.SETFILTER("No.",DocNoFilter);
    ServShptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Service Shipment Header",0,sText005,ServShptHeader.COUNT);
    END;
    IF ServInvHeader.READPERMISSION THEN BEGIN
    ServInvHeader.RESET;
    ServInvHeader.SETFILTER("No.",DocNoFilter);
    ServInvHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Service Invoice Header",0,sText003,ServInvHeader.COUNT);
    END;
    IF ServCrMemoHeader.READPERMISSION THEN BEGIN
    ServCrMemoHeader.RESET;
    ServCrMemoHeader.SETFILTER("No.",DocNoFilter);
    ServCrMemoHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Service Cr.Memo Header",0,sText004,ServCrMemoHeader.COUNT);
    END;
    IF IssuedReminderHeader.READPERMISSION THEN BEGIN
    IssuedReminderHeader.RESET;
    IssuedReminderHeader.SETFILTER("No.",DocNoFilter);
    IssuedReminderHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Issued Reminder Header",0,Text006,IssuedReminderHeader.COUNT);
    END;
    IF IssuedFinChrgMemoHeader.READPERMISSION THEN BEGIN
    IssuedFinChrgMemoHeader.RESET;
    IssuedFinChrgMemoHeader.SETFILTER("No.",DocNoFilter);
    IssuedFinChrgMemoHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Issued Fin. Charge Memo Header",0,Text007,
    IssuedFinChrgMemoHeader.COUNT);
    END;
    IF PurchRcptHeader.READPERMISSION THEN BEGIN
    PurchRcptHeader.RESET;
    PurchRcptHeader.SETFILTER("No.",DocNoFilter);
    PurchRcptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Purch. Rcpt. Header",0,Text010,PurchRcptHeader.COUNT);
    END;
    IF PurchInvHeader.READPERMISSION THEN BEGIN
    PurchInvHeader.RESET;
    PurchInvHeader.SETFILTER("No.",DocNoFilter);
    PurchInvHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Purch. Inv. Header",0,Text008,PurchInvHeader.COUNT);
    END;
    IF ReturnShptHeader.READPERMISSION THEN BEGIN
    ReturnShptHeader.RESET;
    ReturnShptHeader.SETFILTER("No.",DocNoFilter);
    ReturnShptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Return Shipment Header",0,Text018,ReturnShptHeader.COUNT);
    END;
    IF PurchCrMemoHeader.READPERMISSION THEN BEGIN
    PurchCrMemoHeader.RESET;
    PurchCrMemoHeader.SETFILTER("No.",DocNoFilter);
    PurchCrMemoHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Purch. Cr. Memo Hdr.",0,Text009,PurchCrMemoHeader.COUNT);
    END;
    IF ProductionOrderHeader.READPERMISSION THEN BEGIN
    ProductionOrderHeader.RESET;
    ProductionOrderHeader.SETRANGE(
    Status,
    ProductionOrderHeader.Status::Released,
    ProductionOrderHeader.Status::Finished);
    ProductionOrderHeader.SETFILTER("No.",DocNoFilter);
    InsertIntoDocEntry(
    DATABASE::"Production Order",0,Text99000000,ProductionOrderHeader.COUNT);
    END;
    IF TransShptHeader.READPERMISSION THEN BEGIN
    TransShptHeader.RESET;
    TransShptHeader.SETFILTER("No.",DocNoFilter);
    TransShptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Transfer Shipment Header",0,Text019,TransShptHeader.COUNT);
    END;
    IF TransRcptHeader.READPERMISSION THEN BEGIN
    TransRcptHeader.RESET;
    TransRcptHeader.SETFILTER("No.",DocNoFilter);
    TransRcptHeader.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Transfer Receipt Header",0,Text020,TransRcptHeader.COUNT);
    END;
    IF PostedWhseShptLine.READPERMISSION THEN BEGIN
    PostedWhseShptLine.RESET;
    PostedWhseShptLine.SETCURRENTKEY("Posted Source No.","Posting Date");
    PostedWhseShptLine.SETFILTER("Posted Source No.",DocNoFilter);
    PostedWhseShptLine.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Posted Whse. Shipment Line",0,
    PostedWhseShptLine.TABLECAPTION,PostedWhseShptLine.COUNT);
    END;
    IF PostedWhseRcptLine.READPERMISSION THEN BEGIN
    PostedWhseRcptLine.RESET;
    PostedWhseRcptLine.SETCURRENTKEY("Posted Source No.","Posting Date");
    PostedWhseRcptLine.SETFILTER("Posted Source No.",DocNoFilter);
    PostedWhseRcptLine.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Posted Whse. Receipt Line",0,
    PostedWhseRcptLine.TABLECAPTION,PostedWhseRcptLine.COUNT);
    END;
    IF GLEntry.READPERMISSION THEN BEGIN
    GLEntry.RESET;
    GLEntry.SETCURRENTKEY("Document No.","Posting Date");
    GLEntry.SETFILTER("Document No.",DocNoFilter);
    GLEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"G/L Entry",0,GLEntry.TABLECAPTION,GLEntry.COUNT);
    END;
    IF VATEntry.READPERMISSION THEN BEGIN
    VATEntry.RESET;
    VATEntry.SETCURRENTKEY("Document No.","Posting Date");
    VATEntry.SETFILTER("Document No.",DocNoFilter);
    VATEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"VAT Entry",0,VATEntry.TABLECAPTION,VATEntry.COUNT);
    END;
    IF CustLedgEntry.READPERMISSION THEN BEGIN
    CustLedgEntry.RESET;
    CustLedgEntry.SETCURRENTKEY("Document No.");
    CustLedgEntry.SETFILTER("Document No.",DocNoFilter);
    CustLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Cust. Ledger Entry",0,CustLedgEntry.TABLECAPTION,CustLedgEntry.COUNT);
    END;
    IF DtldCustLedgEntry.READPERMISSION THEN BEGIN
    DtldCustLedgEntry.RESET;
    DtldCustLedgEntry.SETCURRENTKEY("Document No.");
    DtldCustLedgEntry.SETFILTER("Document No.",DocNoFilter);
    DtldCustLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Detailed Cust. Ledg. Entry",0,DtldCustLedgEntry.TABLECAPTION,DtldCustLedgEntry.COUNT);
    END;
    IF ReminderEntry.READPERMISSION THEN BEGIN
    ReminderEntry.RESET;
    ReminderEntry.SETCURRENTKEY(Type,"No.");
    ReminderEntry.SETFILTER("No.",DocNoFilter);
    ReminderEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Reminder/Fin. Charge Entry",0,ReminderEntry.TABLECAPTION,ReminderEntry.COUNT);
    END;
    IF VendLedgEntry.READPERMISSION THEN BEGIN
    VendLedgEntry.RESET;
    VendLedgEntry.SETCURRENTKEY("Document No.");
    VendLedgEntry.SETFILTER("Document No.",DocNoFilter);
    VendLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Vendor Ledger Entry",0,VendLedgEntry.TABLECAPTION,VendLedgEntry.COUNT);
    END;
    IF DtldVendLedgEntry.READPERMISSION THEN BEGIN
    DtldVendLedgEntry.RESET;
    DtldVendLedgEntry.SETCURRENTKEY("Document No.");
    DtldVendLedgEntry.SETFILTER("Document No.",DocNoFilter);
    DtldVendLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Detailed Vendor Ledg. Entry",0,DtldVendLedgEntry.TABLECAPTION,DtldVendLedgEntry.COUNT);
    END;
    IF ItemLedgEntry.READPERMISSION THEN BEGIN
    ItemLedgEntry.RESET;
    ItemLedgEntry.SETCURRENTKEY("Document No.");
    ItemLedgEntry.SETFILTER("Document No.",DocNoFilter);
    ItemLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Item Ledger Entry",0,ItemLedgEntry.TABLECAPTION,ItemLedgEntry.COUNT);
    END;
    IF ValueEntry.READPERMISSION THEN BEGIN
    ValueEntry.RESET;
    ValueEntry.SETCURRENTKEY("Document No.");
    ValueEntry.SETFILTER("Document No.",DocNoFilter);
    ValueEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Value Entry",0,ValueEntry.TABLECAPTION,ValueEntry.COUNT);
    END;
    IF PhysInvtLedgEntry.READPERMISSION THEN BEGIN
    PhysInvtLedgEntry.RESET;
    PhysInvtLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    PhysInvtLedgEntry.SETFILTER("Document No.",DocNoFilter);
    PhysInvtLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Phys. Inventory Ledger Entry",0,PhysInvtLedgEntry.TABLECAPTION,PhysInvtLedgEntry.COUNT);
    END;
    IF ResLedgEntry.READPERMISSION THEN BEGIN
    ResLedgEntry.RESET;
    ResLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    ResLedgEntry.SETFILTER("Document No.",DocNoFilter);
    ResLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Res. Ledger Entry",0,ResLedgEntry.TABLECAPTION,ResLedgEntry.COUNT);
    END;
    IF JobLedgEntry.READPERMISSION THEN BEGIN
    JobLedgEntry.RESET;
    JobLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    JobLedgEntry.SETFILTER("Document No.",DocNoFilter);
    JobLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Job Ledger Entry",0,JobLedgEntry.TABLECAPTION,JobLedgEntry.COUNT);
    END;
    IF BankAccLedgEntry.READPERMISSION THEN BEGIN
    BankAccLedgEntry.RESET;
    BankAccLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    BankAccLedgEntry.SETFILTER("Document No.",DocNoFilter);
    BankAccLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Bank Account Ledger Entry",0,BankAccLedgEntry.TABLECAPTION,BankAccLedgEntry.COUNT);
    END;
    IF CheckLedgEntry.READPERMISSION THEN BEGIN
    CheckLedgEntry.RESET;
    CheckLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    CheckLedgEntry.SETFILTER("Document No.",DocNoFilter);
    CheckLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Check Ledger Entry",0,CheckLedgEntry.TABLECAPTION,CheckLedgEntry.COUNT);
    END;
    IF FALedgEntry.READPERMISSION THEN BEGIN
    FALedgEntry.RESET;
    FALedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    FALedgEntry.SETFILTER("Document No.",DocNoFilter);
    FALedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"FA Ledger Entry",0,FALedgEntry.TABLECAPTION,FALedgEntry.COUNT);
    END;
    IF MaintenanceLedgEntry.READPERMISSION THEN BEGIN
    MaintenanceLedgEntry.RESET;
    MaintenanceLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    MaintenanceLedgEntry.SETFILTER("Document No.",DocNoFilter);
    MaintenanceLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Maintenance Ledger Entry",0,MaintenanceLedgEntry.TABLECAPTION,MaintenanceLedgEntry.COUNT);
    END;
    IF InsuranceCovLedgEntry.READPERMISSION THEN BEGIN
    InsuranceCovLedgEntry.RESET;
    InsuranceCovLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    InsuranceCovLedgEntry.SETFILTER("Document No.",DocNoFilter);
    InsuranceCovLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Ins. Coverage Ledger Entry",0,InsuranceCovLedgEntry.TABLECAPTION,InsuranceCovLedgEntry.COUNT);
    END;
    IF CapacityLedgEntry.READPERMISSION THEN BEGIN
    CapacityLedgEntry.RESET;
    CapacityLedgEntry.SETCURRENTKEY("Document No.","Posting Date");
    CapacityLedgEntry.SETFILTER("Document No.",DocNoFilter);
    CapacityLedgEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Capacity Ledger Entry",0,CapacityLedgEntry.TABLECAPTION,CapacityLedgEntry.COUNT);
    END;
    IF WhseEntry.READPERMISSION THEN BEGIN
    WhseEntry.RESET;
    WhseEntry.SETCURRENTKEY("Reference No.","Registering Date");
    WhseEntry.SETFILTER("Reference No.",DocNoFilter);
    WhseEntry.SETFILTER("Registering Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Warehouse Entry",0,WhseEntry.TABLECAPTION,WhseEntry.COUNT);
    END;

    IF ServLedgerEntry.READPERMISSION THEN BEGIN
    ServLedgerEntry.RESET;
    ServLedgerEntry.SETCURRENTKEY("Document No.","Posting Date");
    ServLedgerEntry.SETFILTER("Document No.",DocNoFilter);
    ServLedgerEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Service Ledger Entry",0,ServLedgerEntry.TABLECAPTION,ServLedgerEntry.COUNT);
    END;
    IF WarrantyLedgerEntry.READPERMISSION THEN BEGIN
    WarrantyLedgerEntry.RESET;
    WarrantyLedgerEntry.SETCURRENTKEY("Document No.","Posting Date");
    WarrantyLedgerEntry.SETFILTER("Document No.",DocNoFilter);
    WarrantyLedgerEntry.SETFILTER("Posting Date",PostingDateFilter);
    InsertIntoDocEntry(
    DATABASE::"Warranty Ledger Entry",0,WarrantyLedgerEntry.TABLECAPTION,WarrantyLedgerEntry.COUNT);
    END;

    ///DocExists := FINDFIRST;
    DocExists :=WarrantyLedgerEntry.FINDFIRST;

    SetSource(0D,'','',0,'');
    IF DocExists THEN BEGIN
    IF (NoOfRecords(DATABASE::"Cust. Ledger Entry") + NoOfRecords(DATABASE::"Vendor Ledger Entry") <= 1) AND
    (NoOfRecords(DATABASE::"Sales Invoice Header") + NoOfRecords(DATABASE::"Sales Cr.Memo Header") +
    NoOfRecords(DATABASE::"Sales Shipment Header") + NoOfRecords(DATABASE::"Issued Reminder Header") +
    NoOfRecords(DATABASE::"Issued Fin. Charge Memo Header") + NoOfRecords(DATABASE::"Purch. Inv. Header") +
    NoOfRecords(DATABASE::"Return Shipment Header") + NoOfRecords(DATABASE::"Return Receipt Header") +
    NoOfRecords(DATABASE::"Purch. Cr. Memo Hdr.") + NoOfRecords(DATABASE::"Purch. Rcpt. Header") +
    NoOfRecords(DATABASE::"Service Invoice Header") + NoOfRecords(DATABASE::"Service Cr.Memo Header") +
    NoOfRecords(DATABASE::"Service Shipment Header") +
    NoOfRecords(DATABASE::"Transfer Shipment Header") + NoOfRecords(DATABASE::"Transfer Receipt Header") <= 1)
    THEN BEGIN
    // Service Management
    IF NoOfRecords(DATABASE::"Service Ledger Entry") = 1 THEN BEGIN
    ServLedgerEntry.FINDFIRST;
    IF ServLedgerEntry.Type = ServLedgerEntry.Type::"Service Contract" THEN
    SetSource(
    ServLedgerEntry."Posting Date",FORMAT(ServLedgerEntry."Document Type"),ServLedgerEntry."Document No.",
    2,ServLedgerEntry."Service Contract No.")
    ELSE
    SetSource(
    ServLedgerEntry."Posting Date",FORMAT(ServLedgerEntry."Document Type"),ServLedgerEntry."Document No.",
    2,ServLedgerEntry."Service Order No.")
    END;
    IF NoOfRecords(DATABASE::"Warranty Ledger Entry") = 1 THEN BEGIN
    WarrantyLedgerEntry.FINDFIRST;
    SetSource(
    WarrantyLedgerEntry."Posting Date",'',WarrantyLedgerEntry."Document No.",
    2,WarrantyLedgerEntry."Service Order No.")
    END;

    // Sales
    IF NoOfRecords(DATABASE::"Cust. Ledger Entry") = 1 THEN BEGIN
    CustLedgEntry.FINDFIRST;
    SetSource(
    CustLedgEntry."Posting Date",FORMAT(CustLedgEntry."Document Type"),CustLedgEntry."Document No.",
    1,CustLedgEntry."Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Detailed Cust. Ledg. Entry") = 1 THEN BEGIN
    DtldCustLedgEntry.FINDFIRST;
    SetSource(
    DtldCustLedgEntry."Posting Date",FORMAT(DtldCustLedgEntry."Document Type"),DtldCustLedgEntry."Document No.",
    1,DtldCustLedgEntry."Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Sales Invoice Header") = 1 THEN BEGIN
    SalesInvHeader.FINDFIRST;
    {
    SetSource(
    SalesInvHeader."Posting Date",FORMAT("Table Name"),SalesInvHeader."No.",
    1,SalesInvHeader."Bill-to Customer No.");
    }
    SetSource(
    SalesInvHeader."Posting Date",FORMAT("Document Entry"."Table Name"),SalesInvHeader."No.",
    1,SalesInvHeader."Bill-to Customer No.");

    END;
    IF NoOfRecords(DATABASE::"Sales Cr.Memo Header") = 1 THEN BEGIN
    SalesCrMemoHeader.FINDFIRST;
    SetSource(
    SalesCrMemoHeader."Posting Date",FORMAT("Document Entry"."Table Name"),SalesCrMemoHeader."No.",
    1,SalesCrMemoHeader."Bill-to Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Return Receipt Header") = 1 THEN BEGIN
    ReturnRcptHeader.FINDFIRST;
    SetSource(
    ReturnRcptHeader."Posting Date",FORMAT("Document Entry"."Table Name"),ReturnRcptHeader."No.",
    1,ReturnRcptHeader."Sell-to Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Sales Shipment Header") = 1 THEN BEGIN
    SalesShptHeader.FINDFIRST;
    SetSource(
    SalesShptHeader."Posting Date",FORMAT("Document Entry"."Table Name"),SalesShptHeader."No.",
    1,SalesShptHeader."Sell-to Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Posted Whse. Shipment Line") = 1 THEN BEGIN
    PostedWhseShptLine.FINDFIRST;
    SetSource(
    PostedWhseShptLine."Posting Date",FORMAT("Document Entry"."Table Name"),PostedWhseShptLine."No.",
    1,PostedWhseShptLine."Destination No.");
    END;
    IF NoOfRecords(DATABASE::"Issued Reminder Header") = 1 THEN BEGIN
    IssuedReminderHeader.FINDFIRST;
    SetSource(
    IssuedReminderHeader."Posting Date",FORMAT("Document Entry"."Table Name"),IssuedReminderHeader."No.",
    1,IssuedReminderHeader."Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Issued Fin. Charge Memo Header") = 1 THEN BEGIN
    IssuedFinChrgMemoHeader.FINDFIRST;
    SetSource(
    IssuedFinChrgMemoHeader."Posting Date",FORMAT("Document Entry"."Table Name"),IssuedFinChrgMemoHeader."No.",
    1,IssuedFinChrgMemoHeader."Customer No.");
    END;

    IF NoOfRecords(DATABASE::"Service Invoice Header") = 1 THEN BEGIN
    ServInvHeader.FIND('-');
    SetSource(
    ServInvHeader."Posting Date",FORMAT("Document Entry"."Table Name"),ServInvHeader."No.",
    1,ServInvHeader."Bill-to Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Service Cr.Memo Header") = 1 THEN BEGIN
    ServCrMemoHeader.FIND('-');
    SetSource(
    ServCrMemoHeader."Posting Date",FORMAT("Document Entry"."Table Name"),ServCrMemoHeader."No.",
    1,ServCrMemoHeader."Bill-to Customer No.");
    END;
    IF NoOfRecords(DATABASE::"Service Shipment Header") = 1 THEN BEGIN
    ServShptHeader.FIND('-');
    SetSource(
    ServShptHeader."Posting Date",FORMAT("Document Entry"."Table Name"),ServShptHeader."No.",
    1,ServShptHeader."Customer No.");
    END;

    //Purchase
    IF NoOfRecords(DATABASE::"Vendor Ledger Entry") = 1 THEN BEGIN
    VendLedgEntry.FINDFIRST;
    SetSource(
    VendLedgEntry."Posting Date",FORMAT(VendLedgEntry."Document Type"),VendLedgEntry."Document No.",
    2,VendLedgEntry."Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Detailed Vendor Ledg. Entry") = 1 THEN BEGIN
    DtldVendLedgEntry.FINDFIRST;
    SetSource(
    DtldVendLedgEntry."Posting Date",FORMAT(DtldVendLedgEntry."Document Type"),DtldVendLedgEntry."Document No.",
    2,DtldVendLedgEntry."Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Purch. Inv. Header") = 1 THEN BEGIN
    PurchInvHeader.FINDFIRST;
    SetSource(
    PurchInvHeader."Posting Date",FORMAT("Document Entry"."Table Name"),PurchInvHeader."No.",
    2,PurchInvHeader."Pay-to Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Purch. Cr. Memo Hdr.") = 1 THEN BEGIN
    PurchCrMemoHeader.FINDFIRST;
    SetSource(
    PurchCrMemoHeader."Posting Date",FORMAT("Document Entry"."Table Name"),PurchCrMemoHeader."No.",
    2,PurchCrMemoHeader."Pay-to Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Return Shipment Header") = 1 THEN BEGIN
    ReturnShptHeader.FINDFIRST;
    SetSource(
    ReturnShptHeader."Posting Date",FORMAT("Document Entry"."Table Name"),ReturnShptHeader."No.",
    2,ReturnShptHeader."Buy-from Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Purch. Rcpt. Header") = 1 THEN BEGIN
    PurchRcptHeader.FINDFIRST;
    SetSource(
    PurchRcptHeader."Posting Date",FORMAT("Document Entry"."Table Name"),PurchRcptHeader."No.",
    2,PurchRcptHeader."Buy-from Vendor No.");
    END;
    IF NoOfRecords(DATABASE::"Posted Whse. Receipt Line") = 1 THEN BEGIN
    PostedWhseRcptLine.FINDFIRST;
    SetSource(
    PostedWhseRcptLine."Posting Date",FORMAT("Document Entry"."Table Name"),PostedWhseRcptLine."No.",
    2,'');
    END;
    END ELSE BEGIN
    IF DocNoFilter <> '' THEN
    IF PostingDateFilter = '' THEN
    MESSAGE(Text011)
    ELSE
    MESSAGE(Text012);
    END;
    END ELSE
    IF PostingDateFilter = '' THEN
    MESSAGE(Text013)
    ELSE
    MESSAGE(Text014);

    UpdateFormAfterFindRecords;
    Window.CLOSE;

    is this code is enough,but while running the report it was showing blank black page....
    i have done some modifications in the above code
    like table name,reset,deleteall...
    can you give me suggestion please
    thank you
Sign In or Register to comment.