Suggest a new Idea

  • 0

    Improved use of the "Invoice Posting Buffer" table

    Suggested by CHOPIN AlainNew 0
    Category: Audit workbench

    ISSUE
    Any document posting (sales, Purchase and Service ) must fill the Invoice Posting Buffer table. But the primary key is fixed and we can't modify this when we develop an extension.

    ONE SOLUTION
    I propose to modify this key in order to calculate the break according to fields that we can add in our developpment.

    To do that, you just must create a unique key that defines the combination that references a set of fields.

    For this, we can use a primary key based on the calculation of a cheksum of a string type. Since this checksum is unique for a given combination, it will suffice to add, to the string, our fields we want to add to define a new combination to the primary key.

    This code can call before inserting data into this table and you can publish an event to allow us to add fields in the combination calculation

    RISK
    The potential risks would be related to the validation order of this table in the document validation codeunit if the execution order is really important.