web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How Invoice Post. Buffer Works

(0) ShareShare
ReportReport
Posted on by

Hi Everyone. 

I know Invoice Post. Buffer is use to create entries for G/L entries. Depending on the primary key of the Invoice Post. Buffer, entries get created.

I want to know how the system knows when to create a new entry? Do we need to specify the key to use? 

In the "PrepareSales(VAR SalesLine : Record "Sales Line")" function there no place specify how and when to create new entry. 

My actual requirement is to group item ledger entry based on Sell to Customer and Item No and then insert into a new table. My idea is to use a same way of Invoice Post. Buffer. 

*This post is locked for comments

I have the same question (0)
  • Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Yu can have a look in the Codeunit 80, FillInvPostingBuffer function.

  • Community Member Profile Picture
    on at

    Hi,

    FillInvPostingBuffer call PrepareSales functions. That is it, it does not say when to create the new line. I want to know how the system knows when to create the new line based on the primary key.

    Example, if we want to create G/L entries base on sales line description then we only need to alter the primary key of the Invoice Post. Buffer table. Then system will start to create entries based on the new primary key.

    I want to know how the system know it?

  • Rajasekhar@MS Profile Picture
    5,569 on at

    Hi

    Have you checked where the FillInvPostingBuffer function used in codeunit 80 or you have only checked the function only.

  • Community Member Profile Picture
    on at

    I checked.

         IF (SalesLine.Type >= SalesLine.Type::"G/L Account") AND (SalesLine."Qty. to Invoice" <> 0) THEN BEGIN

           AdjustPrepmtAmountLCY(SalesLine);

           // Copy sales to buffer

           FillInvPostingBuffer(SalesLine,SalesLineACY);

  • Rajasekhar@MS Profile Picture
    5,569 on at

    The Invoice Post. Buffer Group" the GL entries, grouped by Type,G/L Account,Gen. Bus. Posting Group,Gen. Prod. Posting Group,VAT Bus. Posting Group,VAT Prod. Posting Group,Tax Area Code,Tax Group Code,Tax Liable,Use Tax,Dimension Entry No.,Job No.,Fixed Asset Line No. i.e by the key.

  • Community Member Profile Picture
    on at

    Thank you for trying to help me. But I really appreciate if you can read my question again. I know what you mention and my question is how the code get to know about the table key when there is no code about it.  

  • Suggested answer
    Amol Salvi Profile Picture
    18,698 on at

    Hi,

    When record getting inserted based on primary key then system checks wheteher the record exist in table and if not then it will insert the record.

  • Suggested answer
    Jens Glathe Profile Picture
    6,092 on at

    Hi,

    PrepareSales() for instance fills in the fields of the Invoice Posting Buffer. As Amol said, when the record is tried to be inserted into the temporary table, the system checks the fields according to the primary key of the table (as always). If the primary key already exists, the record is not inserted. So... if you want a ditinction by another field (ex: Description), you need to ad this field to the primary key of T49. But, caution with this: The primary key is quite long already, it can only contain 16 fields. Because of this, "we" (plexada.com) have developed a small logic called SigleLineID which solves this issue. You can basically add as many fields as you like to the "distinct" list, and it works since 2010. It is part of our BuildingBlocks AddOn.

    with best regards

    Jens

  • Nareshwar Raju Vaneshwar Profile Picture
    5,596 on at

    Hi Jens,

    Thank you for the input. Can you share your SingleLineID to the public? Maybe a blog post would do.

  • Jens Glathe Profile Picture
    6,092 on at

    Hi Nareshwar,

    well, no. It is not that hard for an exerienced developer to do this. If Microsoft would integrate it as standard functionality, that would be another matter, but they are interested in other things lately.

    with best regards

    Jens

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans