Add total Amount in shipment header

toumatouma Member Posts: 4
I need to add in the shipment header the total amount.
How can I add it? Any help please. :?:
Dynamics NAV (V5.0)

BR

Comments

  • garakgarak Member Posts: 3,263
    edited 2008-12-22
    per default it's not possible because there are no "Amount" field in the Line table .
    So, if you realy need it, you must create new fields in the shipment line table (amount / Amount Including VAT).
    these fields you fill in the posting codeunit. To show the amount sum in the header you can create there a Flowfield.
    Check how NAV does this in the Invoice Header table and Invoice Line table

    But why do you need this in the Shipment document?

    Regards
    Do you make it right, it works too!
  • toumatouma Member Posts: 4
    Think you for your reply, I add the amount in shipment line, but I can’t add any caption in shipment header, Is protected, I received a message “contact your administrator…” I check to desactive the code unit 391

    the code unit too 391:

    //SalesShptHeader := Rec;
    //SalesShptHeader.LOCKTABLE;
    //SalesShptHeader.FIND;
    //xRecRef.GETTABLE(SalesShptHeader);
    //SalesShptHeader."Shipping Agent Code" := "Shipping Agent Code";
    //SalesShptHeader."Shipping Agent Service Code" := "Shipping Agent Service Code";
    //SalesShptHeader."Package Tracking No." := "Package Tracking No.";
    //SalesShptHeader.MODIFY;
    //Rec := SalesShptHeader;
    //RecRef.GETTABLE(SalesShptHeader);
    //ChangeLogMgt.LogModification(RecRef,xRecRef);

    ... I don't find the solution..
  • garakgarak Member Posts: 3,263
    can you create new fields (>= 50000) in table 110 / 111 ?

    The amount lines in the Sales Invoice table are filled in CU 80 (transferfields).
    So this is your place to fill also your new fields in Sales Invoice line (if you have license permissions).
    But other question? You are new in NAV programming? Yes or NO?
    If yes, ask also a senior NAV developer to help you (to make no mistakes), because u must change then a posting codeunit.

    check in CU 80 where the SalesShptLine is created and insert before the SalesShptLine.insert statement something like this.
    IF (SalesShptLine.Quantity <> 0) THEN BEGIN
      SalesShptLine.Amount := TempSalesLine.Amount;
      SalesShptLine."Amount Including VAT" := TempSalesLine."Amount Including VAT";
      SalesShptLine."Inv. Discount Amount" := TempSalesLine."Inv. Discount Amount";
      SalesShptLine."Line Amount" := TempSalesLine."Line Amount"; //(Display)";
      SalesShptLine."VAT Identifier" := TempSalesLine."VAT Identifier";
    END;
    

    But ask before a senior developer to help you, if you are new in NAV.

    Regards
    Do you make it right, it works too!
  • Alex_ChowAlex_Chow Member Posts: 5,063
    touma wrote:
    I need to add in the shipment header the total amount.
    How can I add it? Any help please. :?:
    Dynamics NAV (V5.0)

    BR

    Without modifying tables and mess with posting routines, the easiest way is to sum up the amount is to sum up all the related Item Ledger, resource ledger, and other ledgers that the shipment affects and put the total on a text box or when you push F9.

    You can check on how the Navigate feature in NAV does this.
  • toumatouma Member Posts: 4
    Yes, but how can I do this ?
Sign In or Register to comment.