how to pass the information after posting in sales order?

Tejaswini
Member Posts: 75
I have some fields in sales Line, and in sales order I gave the data to those fields but after invoicing how can I pass the information of those fields to Cust.Ledger entry table.
0
Best Answers
-
using flowfields in ledger entry tables can reduce performance.
so better add the needed fields in ledger entry table.
edit table 21 cust. ledger entry
goto fct. CopyFromGenJnlLine(GenJnlLine : Record "Gen. Journal Line")
add your code at the end of the fct.
load the document with "Document Type" and "Document No."
set the values.
best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/5 -
yes, InitCustLedgEntry is an existing function in that codeunit.
the code above is already existing. so nothing to do for you.
... means: some lines in between
the shown code ist part of function "PostCust" in codeunit 12.
there goto line
CustLedgEntry.INSERT;
and write your own code above that line as shown in the code above.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/5
Answers
-
Dear Tejaswini,
You can change the posting codeunits (sales = 80, ledger entries = 12) to achieve this but what is your target?
You could also use flow fields to lookup information in the posted documents.
Best regards,
Sebastien0 -
Yes, I have observed those codeunits, but where can I assign my field and in which function? My target is to dispaly the total amount present in amount including tax field in customer ledger entry after posting and display the charges that I have added this field in sales Line table before posting I added charges amount to amount including tax field, but it didn't display the total amount present in amount including tax field in customer ledger entry table?
please help me
0 -
using flowfields in ledger entry tables can reduce performance.
so better add the needed fields in ledger entry table.
edit table 21 cust. ledger entry
goto fct. CopyFromGenJnlLine(GenJnlLine : Record "Gen. Journal Line")
add your code at the end of the fct.
load the document with "Document Type" and "Document No."
set the values.
best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/5 -
fct.copy means??
0 -
Can U please explain me in detail with code
0 -
edit table 21 "cust. ledger entry" (button design in development environment).
search for function (fct.) CopyFromGenJnlLine.
in this function the fields of a new cust. ledger entry are set.
you only have to add some lines of code at the end.
you can at least add the values of the additional fields from sales header here.
fields "document type" and "document no." are the key fields of table sales header. with them you can load the according sales header record (SalesHeader.GET("Document Type","Document No.");).
after that write something like that ...
CustLedgerEntry."Your Field 1" := SalesHeader."Your Field 1";
...best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
i checked again.
it's better you add you code to codeunit (CU) 12.
scroll down to function PostCust.
...
DtldCustLedgEntry.LOCKTABLE;
CustLedgEntry.LOCKTABLE;
InitCustLedgEntry(GenJnlLine,CustLedgEntry); // here above fct. CopyFromGenJnlLine is called
IF NOT Cust."Block Payment Tolerance" THEN
...
CVLedgEntryBuf.CopyFromCustLedgEntry(CustLedgEntry); // the new created cust.led.entry record is copied and then changed. your fields and values are not copied here.
...
// Post customer entry
CVLedgEntryBuf.CopyToCustLedgEntry(CustLedgEntry); // the changed data ist copied back to the cust.led.entry record
CustLedgEntry."Amount to Apply" := 0;
CustLedgEntry."Applies-to Doc. No." := '';
// start her your own code
// declare local variable SalesHeader of type "Sales Header"
// e.g.
SalesHeader.get(CustLedgEntry."document type",CustLedgEntry."document no.");
CustLedgEntry."your field 1" := SalesHeader."Your Field 1";
...
// end of your code
CustLedgEntry.INSERT;
...best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
Thank you for your valuable information
0 -
InitCustLedgEntry(GenJnlLine,CustLedgEntry); how can I declare this in C/AL Variables?
Is InitCustLedgEntry a function?0 -
yes, InitCustLedgEntry is an existing function in that codeunit.
the code above is already existing. so nothing to do for you.
... means: some lines in between
the shown code ist part of function "PostCust" in codeunit 12.
there goto line
CustLedgEntry.INSERT;
and write your own code above that line as shown in the code above.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/5 -
Thank You,
I got it0 -
I have one more question , can u please help me?
0 -
Hello...0
-
Charges amount should get added to the amount including tax field while posting in sales order and that amount should post to the item for example amount including field has 100 and charges has 10 and while posting amount including field should has 110 and get posted the item amount as 110 in item card of sales amount(actual) field please suggest me....0
-
why not use sales lines of type "charge (item)"? check if there are appropriate entries in the list of the charges. if not simply create a new one.
for details follow https://msdn.microsoft.com/en-us/library/hh173037(v=nav.90).aspx
best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0 -
Yes I created0
-
Now my question is how to post the amount in carrier charges as item charges I want to post the amount only present in carrier charges field0
-
but when ever I am posting in sales order the amount present in amount including tax field is get posted but I don't want that I just want only to post the amount field that I have created
please suggest me where can I change the code to achieve this.....0 -
Hi Tejaswini,
Glad someone showed you where to find .INSERT in code unit 12.
@FlowFields: Regarding flow fields and performance I wanted to clarify this depends on how well your indexes are defined, how complex the conditions are to search for information and where you want to display the flow fields. I don't think one should generally avoid flowfields in these tables: https://blogs.msdn.microsoft.com/nav/2014/11/12/microsoft-dynamics-nav-faster-than-ever/
@Item Charges: http://forum.mibuso.com/discussion/67029/about-carrier-charges#latest
I think I understood you now: do you mean how to post item charges without applying taxes / VAT?
Best regards,
Sébastien0 -
Auto posting...0
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