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?
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... ;-)
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.
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;
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
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:
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.