We have a requriement where we need to copy couple of fields in the Sales Invoice Header to the Cust. Ledger Entry table, when an invoice/credit memo is posted.
Right now I believe during the posting process quite a few fields are copied over to the Cust. Ledger Entry table from the Sales Header table. We have added a new field called CRM Order No. & Actual Advertiser Name, in the Sales Header table, Sales Invoice Header table and Cust. Ledger Entry tables. When posting an invoice, the values from the said fields are copied over to the Sales Inovice Header table but not the Cust Ledger Entry. Can someone please let us know how to affect this?
Second Query:
We are trying to include a new table the “customer detail trail balance” report. The challange here is to show value from a table linked to the Cust. Ledger Entry in the same line as the Cust Ledger Entry. But the value of the new table is only displayed in a new line below. When we try to move the field along side the Cust Ledger Entry section, it starts displaying the value from the next line onwards and repeats it if the value is null for the next record.
For first inquery, start code coverage before posting. Then after posting check which codeunits are run. and by going to the code find a suitable place to fit your customization.
For second inquiry please explain more. Is there any relationship btw Cust ledger entry table and your new table?
Thanks for your reply. Tried doing the code coverage but quite difficult to spot exactly where it initiates the variables to write to the Cust. Ledger entry form. Will continue looking.
In the second query the new table I have created is to store invoice nos. and some additional information which will not be stored in Navision Tables. We are actually importing invoices generated on a different system directly to Navision (using dataports).
Hence, I was trying to link the new table with the Cust. Led. Entry. table with the Doc. No. field. and it works fine but the problem is when I include it as a part of the report. It show up as a separate section. Hence, it gets value from that table once the Cust.Ledger.Entry. section is displayed.
If I understand you correctly then you want to print the details from your new table in the same section as the customer ledger entry. The way to do this is not to create a new section for the new table but create a variable of type record and find / calculate the values needed to print. The trick is to get the correct trigger to place your code into. The two most likely places are in the onaftergetrecord of the dataitem or in the presection of the section you want to print.
Regarding new fields in Customer Ledger Entry: The customer ledger entries are created in Codeunit 12. They are populated from the General Journal Line. CU12 is one of the NAV core codeunits. If you make changes, please be sure that you understand the changes you are doing and that they do not do harm…
Thanks for the post. Yes, I did look at amending the codeunit 12 and basically I was trying to create two new fields in the GenJnlLine Table and record set and assigin values from new tables created in the Sales Header table. But on running the code the GenJnlLine object did not receive the values for the new fields added. Might have to look further to see how the original values are passed.
eg: We have a line in the codeunit which is as follows