Quantcast
Viewing all articles
Browse latest Browse all 64865

Forum Post: RE: Search Mode

There could be many reasons for this.  Slow or bad setup hardware, Customizations, massive data, etc.

We have a million Posted Invoices so I feel your pain.  And I hate going into Posted invoices.

So we made two changes to help us get to an invoice immediately.

One is a text box on the menu called "Quick Find Invoice" where you can enter or scan any invoice # and it brings you right to the invoice.  The code on this textbox is as follows:

OnAfterValidate()
IF InvSearch = ''THEN BEGIN
    MESSAGE('You Cannot Search A Blank Number!');
END ELSE BEGIN
    SalesInvoiceHeader.SETCURRENTKEY("No.");
    SalesInvoiceHeader.SETRANGE("No.",InvSearch);
    IF SalesInvoiceHeader.FIND('+') THEN BEGIN
        CLEAR(InvoiceForm);
        InvoiceForm.LOOKUPMODE(TRUE);
        InvoiceForm.SETTABLEVIEW(SalesInvoiceHeader);
        InvoiceForm.RUNMODAL;
        CLEAR(InvSearch);
    END ELSE BEGIN
       MESSAGE('Order Not Found');
       CLEAR(InvSearch);
       CurrForm.UPDATE;
   END;
END;

The second change is on the Customer Ledger Entry Form (#25).  When you click on the "Document No" it has a lookup that brings you right there in a flash.  The code behind that is:

OnLookup(VAR Text : Text[1024];) : Boolean
CASE "Document Type" OF "Document Type"::"Credit Memo":
BEGIN
   CLEAR(PostedCreditForm);
   PostedCreditInv.SETCURRENTKEY("Sell-to Customer No.","No.");
   PostedCreditInv.SETFILTER(PostedCreditInv."No.","Document No.");
   PostedCreditForm.LOOKUPMODE(TRUE );
   PostedCreditForm.SETTABLEVIEW(PostedCreditInv);
   PostedCreditForm.RUNMODAL;
END
END;
CASE "Document Type" OF "Document Type"::Invoice:
BEGIN
   CLEAR(PostedSalesForm);
   PostedSalesInv.SETCURRENTKEY("Sell-to Customer No.","No.");
   PostedSalesInv.SETFILTER(PostedSalesInv."No.","Document No.");
   PostedSalesForm.LOOKUPMODE(TRUE );
   PostedSalesForm.SETTABLEVIEW(PostedSalesInv);
   PostedSalesForm.RUNMODAL;
END
END;
CASE "Document Type" OF "Document Type"::Payment:
BEGIN
   CLEAR(PostedPaymentForm);
   PostedPaymentInv.SETFILTER(PostedPaymentInv."No.","Document No.");
   PostedPaymentForm.LOOKUPMODE(TRUE );
   PostedPaymentForm.SETTABLEVIEW(PostedPaymentInv);
   PostedPaymentForm.RUNMODAL;
END
END;


Viewing all articles
Browse latest Browse all 64865

Trending Articles