G/L description to contain same text as Invoice Line

carl
Member Posts: 19
I have a client that wants the following customization:
- When the user posts an Invoice he inputs a particular description in the Invoice line.
- When the invoice is posted and the user goes to 'Navigate' and chooses to see G/L entries, in the description field there is something like 'Invoice SIV07000010'.
- This client wants the description he first inputted in the invoice lines to be also shown in the G/L entries instead of the 'Invoice SIV07000010'.
Any ideas anyone?
Thanks and regards.
- When the user posts an Invoice he inputs a particular description in the Invoice line.
- When the invoice is posted and the user goes to 'Navigate' and chooses to see G/L entries, in the description field there is something like 'Invoice SIV07000010'.
- This client wants the description he first inputted in the invoice lines to be also shown in the G/L entries instead of the 'Invoice SIV07000010'.
Any ideas anyone?
Thanks and regards.
0
Comments
-
carl wrote:- This client wants the description he first inputted in the invoice lines to be also shown in the G/L entries instead of the 'Invoice SIV07000010'.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
In that case the client has agreed that the FIRST description is taken into consideration to avoid confusion.0
-
You need to check codeunit 80 (for sales) or 90 (for purchase) where the temptable is filled to be used to post in G/L.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Show Posting Description field.
Or you can use Posting Desc. Code0 -
I tried using TempSalesLine.Description. It works fine when I have just one invoice line. When i have more than 1 invoice line all the descriptions are set to the description of the LAST invoice line.
What is needed is that if for example you have 2 invoice lines (2 seperate G/L accounts), the G/L Entries should hold both descriptions of Invoice Line 1(firs account) and Invoice Line 2(second account). Thanks all for your help and time!0 -
Hi,
This is a very common modification request from customers and we always apply it. See code below :Custom Code To Replace G/L Entry Descriptions With The Sales/Purchase Invoice Line Description ============================================================================================== Table 49 - Invoice Post. Buffer =============================== New Fields ---------- 50000 Posting Description (Text 50) 50001 Line No. (Integer) CodeUnit 90 - Purch.-Post ========================= OnRun() Trigger --------------- .... GenJnlLine.INIT; GenJnlLine."Posting Date" := "Posting Date"; GenJnlLine."Document Date" := "Document Date"; // ************************************************************************************************* // Following Field Assignment Modified By J.Wareham 21/09/2004 To Post Actual Line Description To GL IF InvPostingBuffer[1]."Posting Description" <> '' THEN GenJnlLine.Description := InvPostingBuffer[1]."Posting Description" ELSE GenJnlLine.Description := "Posting Description"; // ************************************************************************************************* GenJnlLine."Reason Code" := "Reason Code"; GenJnlLine."Document Type" := GenJnlLineDocType; GenJnlLine."Document No." := GenJnlLineDocNo; GenJnlLine."External Document No." := GenJnlLineExtDocNo; .... FillInvPostingBuffer() Trigger ------------------------------ ... // ************************************************************************************************* // Following Code Added By J.Wareham 21/09/2004 To Pass Actual Line Description Through To GL Entry IF (PurchLine.Type = PurchLine.Type::"G/L Account") OR (PurchLine.Type = PurchLine.Type::Item) THEN BEGIN InvPostingBuffer[1]."Posting Description" := PurchLine.Description; InvPostingBuffer[1]."Line No." := PurchLine."Line No."; END; // ************************************************************************************************* TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line"); TempDocDim.SETRANGE("Line No.","Line No."); UpdInvPostingBuffer; END; CodeUnit 80 - Sales-Post ========================= OnRun() Trigger --------------- .... GenJnlLine.INIT; GenJnlLine."Posting Date" := "Posting Date"; GenJnlLine."Document Date" := "Document Date"; // ************************************************************************************************* // Following Field Assignment Modified By J.Wareham 21/09/2004 To Post Actual Line Description To GL IF InvPostingBuffer[1]."Posting Description" <> '' THEN GenJnlLine.Description := InvPostingBuffer[1]."Posting Description" ELSE GenJnlLine.Description := "Posting Description"; // ************************************************************************************************* GenJnlLine."Reason Code" := "Reason Code"; GenJnlLine."Document Type" := GenJnlLineDocType; GenJnlLine."Document No." := GenJnlLineDocNo; GenJnlLine."External Document No." := GenJnlLineExtDocNo; .... FillInvPostingBuffer() Trigger ------------------------------ ... // ************************************************************************************************* // Following Code Added By J.Wareham 21/09/2004 To Pass Actual Line Description Through To GL Entry IF SalesLine.Type = SalesLine.Type::"G/L Account" THEN BEGIN InvPostingBuffer[1]."Posting Description" := SalesLine.Description; InvPostingBuffer[1]."Line No." := SalesLine."Line No."; END; // ************************************************************************************************* TempDocDim.SETRANGE("Table ID",DATABASE::"Purchase Line"); TempDocDim.SETRANGE("Line No.","Line No."); UpdInvPostingBuffer; END;
1 -
[Topic moved from Navision forum to Navision Tips & Tricks forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Solved as per Jonathan2708's code. Thanks all for your help and time.0
-
Hi, just had a customer wanting this same solution.
Is it possible by now, to do this functionality by hooking up on events instead of changing code inside CU 90?0 -
Easiest way is to put field "Posting Description" in sales/purchase header forms/pages and tell a customer that he can change it here as he wants.0
-
Customer have multiple lines with type GL Account. So the posting description on header cannot help us. As that relation is 1 - n, one to many. We need a one to one relation.
Factbox could be an idea if customer can se the direct line in factbox, and not just all the lines form sales/purch.0 -
The direct line jo see on the main page. Factbox is for related info, like sales/purch lines!
With the factbox approach you need to block deletion of posted documents for the period you need to look back.
But remember it is a 1-N relationship, so dont dtry to solved it in the 1.
Another way is to make sure all lines in a invoice have different dimensions, this will cause multiple entries. But then you would have to make a system for that.
But anything else than changing the posting routines.
I have big customers with alot of customizations, but Codeunit 80 is untouched. You just have to change your thinking, and find another way, than the straight forward one.
AL/Extensions forces you down this path.Follow me on my blog juhl.blog0 -
Hi @Jonathan2708 ,The above solution is not working on Nav 20180
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