Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to create and fill a G/L Register to view all applied entries after running a report?

Posted on by Microsoft Employee

Hey guys,
I plan to do the following:

I have a report that I can use to apply all my  open entries. Now I would like to see which payment was applied with which credit.

For this I want to create something like a G/L Register. I would use a classic G/L Register as a guide.

Have you ever done something like this?
Where in my report should I position myself so that I can then write the data to a separate table? This table should be my G/L Register.

Thank you ;)

  • Suggested answer
    RE: How to create and fill a G/L Register to view all applied entries after running a report?

    Hi,

    There is of course a number of different ways to do this, and without knowing the customer and exact requirements, here is my ideas, based on the standard application (codeunit 12):

    The register is initialized at the beginning of the process:

    [Function StartPosting]

    GLReg.LOCKTABLE;
    IF GLReg.FINDLAST THEN
    GLReg."No." := GLReg."No." + 1
    ELSE
    GLReg."No." := 1;
    GLReg.INIT;
    GLReg."From Entry No." := NextEntryNo;
    GLReg."From VAT Entry No." := NextVATEntryNo;
    GLReg."Creation Date" := TODAY;
    GLReg."Creation Time" := TIME;
    GLReg."Source Code" := "Source Code";
    GLReg."Journal Batch Name" := "Journal Batch Name";
    GLReg."User ID" := USERID;
    IsGLRegInserted := FALSE;

    Then during the process, the entry numbers can get incremented as they get processed. And then in the end, the register gets inserted.

    I think that this makes it easy to collect all the needed data in the register because anywhere you are applying entries, you can update the register at the same time as you go along. The disadvantage may be performance, since you lock the table during the whole process, so if you need to write this for heavy multi user scenarios, then I would consider another solution of maybe collecting it all into a temp table, but only insert the register at the end of the process.

    Just some ideas - again without knowing everything that the process needs to do. Hope it helps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans