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 :
Small and medium business | Business Central, N...
Answered

How to get Temporary Data on G/L Entry after Preview Posting on Journals

(0) ShareShare
ReportReport
Posted on by 30

Hello Experts,

Good  day.

Is there anyway I can get Temporary Data/records on GL Entry after Preview Posting ?

I just want to show it on a report on Journal Page. 

Thanks and God Bless

Regards,

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hello,

    Preview Posting will generate all the entries to the General Ledger Entry and related Entries tables. You can view the entries but it is temporary. You can Open in Excel the Preview Posting General Ledger page.

    Hope this helps.

    Thanks,

    Steve

  • jvillasin Profile Picture
    30 on at

    hello Steven,

    Thanks for you reply. Yes its temporary, but I want to use  those data on a custom report inside BC365 using RDLC, How can I get those Temporary Data on GL Entry after preview posting?

    regards,

    jhan

  • Suggested answer
    Community Member Profile Picture
    on at

    Jhan,

    I am not a programmer and not sure this is possible. Hopefully a Developer can reply here.

    Thanks,

    Steve

  • HoangNam Profile Picture
    315 on at

    Hi!

    You can get GL Entry after Preview Posting.

    I already request Microsoft for this.

    Details: github.com/.../1301

    This feature is already on D365BC version 18. I don't know about another version.

  • jvillasin Profile Picture
    30 on at

    Hello Nam Hoang

    Good day.

    I tried this code on D365BC version 17.3 and still MyRecRef.count is still zero. Am i doing it wrong ? I based this on your discussion on GitHub. 

    Btw, I'm still new on this AL Extension. so please bear with me. 

        var
            GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
            GenJnlPost: Codeunit "Gen. Jnl.-Post";
            PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler";
            ErrorMessageMgt: Codeunit "Error Message Handler";
            MyRecRef: RecordRef;
        begin
            BindSubscription(GenJnlPost);
            GenJnlPostPreview.SetContext(GenJnlPost, GenJournalLineSource);
            IF GenJnlPostPreview.Run() and GenJnlPostPreview.IsSuccess() then begin
                PostingPreviewEventHandler.GetEntries(Database::"G/L Entry", MyRecRef);
                Error(Format(MyRecRef.Count));
            end;
        end;

  • jvillasin Profile Picture
    30 on at

    Also I will try this method on BC365 Version 18.3 Im just doing it on 17.3 because this version is our current DEV/Prod Database.

  • Verified answer
    HoangNam Profile Picture
    315 on at

    You can reference my code.

    I execute this code on Payment Registration page

    local procedure RunReceiptVoucher(AsLump: Boolean)
        var
            ReceiptVoucher: Report "DIC Receipt Voucher";
            GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
            PaymentRegistrationMgt: Codeunit "Payment Registration Mgt.";
            ErrorMessageMgt: Codeunit "Error Message Management";
            ErrorMessageHandler: Codeunit "Error Message Handler";
            PostingPreviewEventHandler: Codeunit "Posting Preview Event Handler";
            RecRef: RecordRef;
            ErrorMsg: Text[250];
        begin
            ErrorMessageMgt.Activate(ErrorMessageHandler);
            BindSubscription(PaymentRegistrationMgt);
            PaymentRegistrationMgt.SetPreviewContext(AsLump);
            GenJnlPostPreview.SetContext(PaymentRegistrationMgt, Rec);
            IF NOT GenJnlPostPreview.Run() AND GenJnlPostPreview.IsSuccess() THEN begin
                GenJnlPostPreview.GetPreviewHandler(PostingPreviewEventHandler);
                PostingPreviewEventHandler.GetEntries(Database::"G/L Entry", RecRef);
                ReceiptVoucher.InitializeForPaymentRegistration(RecRef);
                ReceiptVoucher.Run();
            end else begin
                ErrorMessageMgt.GetLastError(ErrorMsg);
                Error(ErrorMsg);
            end;
        end;
  • jvillasin Profile Picture
    30 on at

    Hello Nam Hoang.

    Thank you for your help. Highly appreciated.

    I would like to  ask 1 more thing. its kind off out topic though.

    If I transfer our Production AL Extension from D365BC v17.3 to  D365BC v18.3,  Do  I need to re download the symbols too ?

  • HoangNam Profile Picture
    315 on at

    Depend your extension.

    But, I think you should check again with symbols of D365BC v18.3

  • jvillasin Profile Picture
    30 on at

    Thank you again, Nam Hoang :)

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 > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,143

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,694 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,067 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans