Posting new fields

RomanRoman Member Posts: 4
Hi everybody,

I have the Problem that I need new fields witch should be passed by the posting-routine, from the Sales Line to the Cust. Ledger Entry. So can me anybody tells how to solve thie Problem?

with best Regards
Roman Klimaschewski

Comments

  • kinekine Member Posts: 12,562
    It is not so easy. Why? Because there is just one Customer Ledger Entry for many Sales Lines... :-) If you want to transfer the value from Sales header, it is easier... ;-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RomanRoman Member Posts: 4
    hi,

    using the Header instead of the Line should be also posible... but what I have to do in this example?

    with best Regards
    Roman Klimaschewski
  • thaugthaug Member Posts: 106
    Check out Codeunit 10201, Transfer Custom Fields. You may be able to work within the confines of standard Navision without having to do too much modification. I have used this, and while it took me a little bit of time to figure out what was going on, it was certainly one of the quickest one-line modifications that I have ever had to do.
    There is no data, only bool!
  • BalelloBalello Member Posts: 61
    Sorry.... not Worldwide, I think. I don't have CDU 10201 and the number is on state customization level.

    :cry:
    I don't envy anybody who caught up his aim. I travel gladly.
  • kinekine Member Posts: 12,562
    Codeunit 10201 is just local US object... not accessible on whole world... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • David_CoxDavid_Cox Member Posts: 509
    This is quite a simple process, 4 steps
    1. Add your field to Table 81 "Gen. Journal Line"
    2. Add your field to Table 21 "Cust. Ledger Entry"

    3. Codeunit 80, and find this text
    // Post customer entry
    Window.UPDATE(4,1);

    at the end of this section about 20 lines add your field
    GenJnlLine."Source Code" := SrcCode;
    GenJnlLine."Posting No. Series" := "Posting No. Series";

    // REF INITIALS DATE
    // -
    GenJnlLine."My New Field" := "My New Field"; from the Sales Header one value per order
    // +

    TempJnlLineDim.DELETEALL;
    TempDocDim.RESET;

    4. Final bit move it to the Ledgers in Codeunit 12 Gen. Jnl.-Post Line

    Look for function PostCust() and add your code again Here
    CustLedgEntry."Payment Tolerance Amount" :=
    ROUND(Currency."Payment Tolerance %" * Amount / 100,Currency."Amount Rounding Precision");

    // REF INITIALS DATE
    // -
    CustLedgEntry."My New Field" := "My New Field"; from the Gen. Journal Line
    // +

    END;
    END;

    DtldCVLedgEntryBuf.DELETEALL;
    DtldCVLedgEntryBuf.INIT;

    See its not that hard, we transfer the field from sales header to general journal line and then to the customer ledger entry. :whistle:

    This is the same scenario for purchases Items, Jobs, Resources ect:
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • kinekine Member Posts: 12,562
    Yes, transfering fields from header easy... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • RomanRoman Member Posts: 4
    Thanks alot this solved my Problem
Sign In or Register to comment.