Thursday, November 7, 2019

NAV - Custom On Lookup Dropdown

Simple lookup filter

field(Barcode; Barcode)

                {

                    ApplicationArea = All;

                    Lookup = true;

                    TableRelation = "LSC Barcodes"."Barcode No." WHERE("Item No."=field(Item));

}

SAAS

Note, filter fields must exist on the Lookup page, ensure you add them with an extension if necessary

field(InvoiceNo; Rec.InvoiceNo)
                {
                     Lookup = true;

                    trigger OnLookup(var Text: Text): Boolean
                    var
                        LookupData: Record "Sales Invoice Header";
                        LookupPage: page "Posted Sales Invoices";
                    begin
                        // Apply filter directly to the record
                        LookupData.CalcFields(DeliveryNo);
                        LookupData.Setfilter("DeliveryNo", '<0'); // Only invoices with no delivery number

                        // Run the standard Sales Invoice List page with the filtered record
                        LookupPage.SetRecord(LookupData);
                        LookupPage.SetTableView(LookupData);
                        LookupPage.LookupMode(True);
                        if LookupPage.RunModal = ACTION::LookupOK THEN BEGIN
                            LookupPage.GETRECORD(LookupData);
                            Rec.Validate(InvoiceNo, LookupData."No.");
                            exit(true);
                        end;
                    end;


OR
*Restart instance after making this modification.

On Page, Set Lookup = Yes

Name DataType Subtype Length
WRL Record Posted Whse. Receipt Lines
RecList Page Posted Whse. Receipt List
FromDate Date
ToDate Date
LPS Record Label Printing Setup


IF LPS.FINDFIRST THEN BEGIN
  FromDate := CALCDATE('-'+FORMAT(LPS."Show Receipts in Range"),TODAY);
  ToDate := CALCDATE(FORMAT(LPS."Show Receipts in Range"),TODAY);
END;
WRL.RESET;
WRL.CALCFIELDS("PO Type Code");
WRL.SETRANGE("PO Type Code",POTypeCode);
CLEAR(RecList);
RecList.SETRECORD(WRL);
RecList.SETTABLEVIEW(WRL);
RecList.LOOKUPMODE(TRUE);
  IF RecList.RUNMODAL = ACTION::LookupOK THEN BEGIN
    RecList.GETRECORD(WRL);
     VALIDATE(Receipt,WRL."No.");
  END;


field("Production Order"; "Production Order")
            {
                ApplicationArea = All;
                lookup = True;
                trigger OnLookup(var Text: Text): Boolean
                var
                    Prdord: record "Production Order";
                    RecList: page "Production Order List";
                    FromDate: date;
                    ToDate: Date;

                begin
                    FromDate := CALCDATE('-' + FORMAT('30D'), TODAY);
                    ToDate := CALCDATE(FORMAT('30D'), TODAY);
                    //Prdord.setrange("Starting Date",fromdate,ToDate);

                    CLEAR(RecList);
                    RecList.SETRECORD(Prdord);
                    RecList.SETTABLEVIEW(PrdOrd);
                    RecList.LOOKUPMODE(TRUE);
                    IF RecList.RUNMODAL = ACTION::LookupOK THEN BEGIN
                        RecList.GETRECORD(PrdOrd);
                        VALIDATE("Production Order", Prdord."No.");
                    END;
                end;

Tuesday, November 5, 2019

NAV CAL - How to calculate to and from range from a dateformula

  FromDate := CALCDATE('-'+FORMAT(LPS."Dateformula"),TODAY);
  ToDate := CALCDATE(FORMAT(LPS."Dateformula"),TODAY);

Friday, November 1, 2019

Dynamics NAV - Purchase Discounts


  1. Customize screen to allow manual amount for discount
  2. Manually split discount over each line
    1. Enter amount on each line item in line discount amount
  3. Enter GL line to inventory account or discounts account as a negative value

NAV Intercompany - Bank Transfers

You cannot do a direct intercompany transfer from one bank account to another.

However, you can do a direct intercompany to the bank g/l account, but doing so will not display the transfer on your bank rec.


  • One way to deal with this is to create a suspense account for the intercompany money transfer.
  • Company 1
    • GL Journal
      • Bank to transfer suspense
    • IC Journal
      • Line1 IC Partner
      • Line2 transfer suspense, IC Acc No = transfer suspense
      • Post and send
  • Company 2
    • Receive and process
    • GL Journal
      • transfer suspense to Bank

Thursday, October 31, 2019

Dynamics NAV - Recurring Methods


  • Fixed
    • Amount does not change after posting
    • The value is split based on the rules set in the Allocations page in the Allocations button
  • Variable
    • Amount is reset to 0 after posting
    • You need to manually re-enter a new value after every posting
    • The value is split based on the rules set in the Allocations page in the Allocations button
  • Balance
    • Journals the balance of the account
    • The value is split based on the rules set in the Allocations page in the Allocations button
  • Reversing Fixed
    • Same as Fixed, but reversal entry is also automatically posted to the next day after posting date
  • Reversing Variable
    • Same as Variable, but reversal entry is also automatically posted to the next day after posting date
  • Reversing Balance
    • Same as Balance, but reversal entry is also automatically posted to the next day after posting date

Document Description Formulas

  • %1 – The current day number
  • %2 – The current week number
  • %3 – The current month number
  • %4 – The current month name
  • %5 – The current accounting period name
  • Eg. RENT-%4

Date Formulas
  • CM+1D first of next month

Dynamics NAV - How to reconcile Inventory to GL

https://www.archerpoint.com/blog/Posts/inventory-general-ledger-reconciliation-microsoft-dynamics-nav

https://dynamics-consultants.co.uk/blog/posts/2017/june/reconciling-inventory-in-microsoft-dynamics-nav/



Wednesday, October 30, 2019

NAV-Configuration Package Import Error-Posting date must have a value in Gen. Journal line: Journal template = GENERAL, Journal batch = XXX, Line number = 10000. The field cannot be zero or empty.

It looks like the TESTFIELD command on the Posting Date field causes this error.

The true cause of this error is a bad configuration package.
Redo the configuration package in the current version of BC/NAV.