Skip to main content

Notifications

Announcements

No record found.

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

Retrieve Line No From Journal

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
    YUN ZHU 73,696 Super User 2024 Season 2 on at
    RE: Retrieve Line No From Journal

    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

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