Saturday, November 30, 2019

NAV - CAL Built-in email functions

T38.SendRecords
T60.SendToEmailVendor
T77.SendEmailtoVendorDirectly
P364.SelectSendingOptions

Wednesday, November 27, 2019

NAV CAL - Change Color


  • Create Global StyleText Text
  • Create Function UpdateStyle, Return Text
  • Update StyleText OnAfterGetRecord
OnAfterGetRecord()
StyleText := UpdateStyle;

UpdateStyle() : Text

IF "Matched Status" = 'Exact Match' THEN BEGIN
EXIT('Favorable');
END ELSE BEGIN
EXIT('Unfavorable');
END;

  • On Page Field Property StyleExpr
    • enter global StyleText



Modify(InventoryField)
        {
            StyleExpr = StyleText;
        }

    trigger OnAfterGetRecord()
    begin
        StyleText := UpdateStyle;
    end;

    procedure UpdateStyle()Text
    begin
        IF Inventory <= "Reorder Point" THEN
            EXIT('UnFavorable');
    End;

    var
        StyleText: Text[20];

LS NAV - Get Retail Item Price with discounts and promos

PROCEDURE GetItemPOSPrice@1000000004(Itm@1000000023 : Text[30]) : Decimal;
    VAR
      PT@1000000000 : Record 99008980;
      PosTerminal@1000000022 : Record 99001471;
      StoreSetup@1000000021 : Record 99001470;
      Item@1000000020 : Record 27;
      ItemVariant@1000000019 : Record 5401;
      TransLine@1000000018 : Record 99008981;
      Customer@1000000017 : Record 18;
      Staff@1000000016 : Record 99001461;
      PosFunc@1000000015 : Codeunit 99008900;
      PosPrice@1000000014 : Codeunit 99008906;
      Globals@1000000013 : Codeunit 99008919;
      gStoreNo@1000000012 : Code[10];
      gPosTerminalNo@1000000011 : Code[10];
      gReceiptNo@1000000010 : Code[20];
      gItemNo@1000000009 : Code[20];
      gQuantity@1000000008 : Decimal;
      gDescription@1000000007 : Text[100];
      gCustomerName@1000000006 : Text[50];
      gPriceInBarcode@1000000005 : Decimal;
      gCalcQty@1000000004 : Decimal;
      gStaffID@1000000003 : Code[20];
      SalesTypeBoxVisible@1000000002 : Boolean INDATASET;
      PriceGrBoxVisible@1000000001 : Boolean INDATASET;
      FinalPrice@1000000024 : Decimal;
    BEGIN
      TransLine.VALIDATE(TransLine.Number,TransLine.Number);
      gQuantity := 1;
      TransLine.VALIDATE(TransLine.Number,Itm);
      TransLine.InsertLine;

      TransLine.GET(TransLine."Receipt No.",TransLine."Line No.");

      Item.GET(TransLine.Number);
      IF Item."Qty. Becomes Negative" THEN BEGIN
        TransLine."Item/Dept. Negative" := TRUE;
        TransLine.VALIDATE(TransLine.Quantity,-gQuantity)
      END
      ELSE
        TransLine.VALIDATE(TransLine.Quantity,gQuantity);
      IF TransLine."Price in Barcode" AND (gQuantity = gCalcQty) THEN
        TransLine.VALIDATE(TransLine.Amount,gPriceInBarcode);


      PosFunc.ChangeVATBusOnLine(PT);
      PosFunc.RecalcSlip(PT);

      EXIT(FinalPrice);
    END;

Tuesday, November 26, 2019

Microsoft Surface - Charging light on charger is blinking or unlit


NAV/BC - Limit Item Master visibility by using user permissions


  • By default, user has no access to anything
    • Each permission rule will only add more permissions
    • No rule will explicitly deny, unless you are using a filter
    • If any rule explicitly gives permission, the user will have permission
  • Permissions
    • Filter On Item Table
      • Ideally, a single role should be created specifically for limiting each user group to a specific division
      • Existing item fields can be used, or a custom field added specifically to manage the Division that can view the item
    • Must create your own SUPER and Foundation and Basic permission sets that do not include the item table you are trying to filter on, otherwise the allow rule will take precedence
      • any item table rule without an item division filter will allow all records

Friday, November 8, 2019

NAV BC - Limited User vs Full User

Limited user can enter data into most screens, but cannot post.

Can Limited user do Purchase Quotes? Yes, but cannot post, only release or send for approval.
Can Limited user do Sales Quotes? Yes, but cannot post, only release or send for approval.


Can Limited user to journal entries? Yes, but cannot post, only release or send for approval.

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));

}

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 TextText)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