How to post?

raja123
Member Posts: 50
Created a field in sales order and I want to post its value to customer ledger entry and item ledger entry. I'm using nav 2017. Which code units are used to do this?and explain me how to achieve this?
0
Best Answers
-
Salesheader.Examplefield (suppose this is your field)
In the table 81 place code in CopyfromSalesHeader function
Examplefield := SalesHeader.Examplefield
In the table 83 place code in CopyfromSalesHeader function
Examplefield:= SalesHeader.Examplefield
In the codeunit 12 in the PostCust function place code
CustLedgEntry.Examplefield := Examplefield
In the codeunit 22 in the function InitItemLedgEntry place code
ItemLedgEntry.Examplefield := ExamplefieldUnited Kingdom5 -
Has it been resolved?United Kingdom5
Answers
-
It is recommended to do posting entries though journal lines. The codeunits you will be using Gen Jnl Post Line and Item Jnl Post Line, you might be need to add code in the gen jnl line or item jnl line tables as well as new NAV versions such as NAV 2017 some functions have been moved to the tables which is good.United Kingdom0
-
Thanks for your reply Developer101. Can you explain a bit detail.0
-
I presume you have a field on sales header. You need to create same type of field in the table 81 and 83.
also in tables 21 and 32 (ledger entries tables)
When posting happens first the value from field in sales header is copied to journal tables which are 81 and 83 then move to 21 and 32.
You need to place your code in Gen Jnl Post Line and Item Jnl Post Line codeunits.United Kingdom0 -
Salesheader.Examplefield (suppose this is your field)
In the table 81 place code in CopyfromSalesHeader function
Examplefield := SalesHeader.Examplefield
In the table 83 place code in CopyfromSalesHeader function
Examplefield:= SalesHeader.Examplefield
In the codeunit 12 in the PostCust function place code
CustLedgEntry.Examplefield := Examplefield
In the codeunit 22 in the function InitItemLedgEntry place code
ItemLedgEntry.Examplefield := ExamplefieldUnited Kingdom5 -
But in codeunit 12 and codeunit 22, there is no Examplefield. from which tables i can get that field?
thanks in advance.0 -
i am only calling it examplefield just to give an example, you need creating your own. This makes me think that you are just starting development?United Kingdom0
-
Yeah you are right! I'm just starting ,
"In the codeunit 12 in the PostCust function place code
CustLedgEntry.Examplefield := Examplefield
In the codeunit 22 in the function InitItemLedgEntry place code
ItemLedgEntry.Examplefield := Examplefield"
where can i get that ' Eaxamplefield' in codeunits??
you want me to create a variable 'Eaxmplefield' In codeunit 12 and 22 ??
or
from which tables i can get that field?0 -
from Item journal line and gen journal line tables where you will need to create fields in these tables.
so basically CustLedgEntry.Examplefield := GenJnlline.examplefield (dont need mention genjnline as its already there)
sames goes for ItemLedgEntry.Examplefield := ExamplefieldUnited Kingdom1 -
Thank you Developer101 for your early and quick response.0
-
Has it been resolved?United Kingdom5
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions