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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Retrieve Line No From Journal

(0) ShareShare
ReportReport
Posted on by 60

HI Experts,

I wrote some code to filter the G/L Journal Lines to update one field in the Payment Journal Line.

But when I tried to Debug the code the Line No Returns as Zero. But I actually have line in the Payment Journal.

I can see the Line No on the "Inspect Page" as "10000" . But my code Returns empty line no.

Here is some part of my code,

 procedure GetAppliedVendorEntries(genjoulin: Record "Gen. Journal Line") "Applied Amount": Decimal
    var
        //GenJournalLine: Record "Gen. Journal Line";
        VendorLedgerEntry: Record "Vendor Ledger Entry";
    begin
        genjoulin.SetRange("Journal Template Name", 'PAYMENT');
        genjoulin.SetRange("Journal Batch Name", 'CASH');
        genjoulin.SetRange("Line No.",genjoulin."Line No.");
        genjoulin.SetRange("Document No.", genjoulin."Document No.");
can you give me some suggestion to understand what i am doing wrong here?

  

  • Suggested answer
    YUN ZHU Profile Picture
    104,157 Super User 2026 Season 2 on at

    Hi, both are genjoulin variable. And genjoulin variable has not used Find (Findset, Findfirst, and so on) yet, so it is empty. You can declare another variable to pass Line No.

    pastedimage1682384511627v1.png

    Hope this helps.

    Thanks.

    ZHU

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 554 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 344 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 189 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans