Skip to main content

Notifications

Small and medium business | Business Central, N...
Answered

Line No. Issue in Payment Journal

(0) ShareShare
ReportReport
Posted on by 382

Hello community, I have created a custom page ("WHT Transaction") as shown in Fig 1. Some of the field in this custom page is filled from "Payment Journal" page and the rest are being filled by another custom table. After filling all the values in "WHT Transaction" I want to put all the values again in the "Payment Journal" using "Post WHT" action as shown in fig 1. For doing so, I have to get the three primary keys of "Payment Journal" i.e. "Journal Template Name", "Journal Batch Name" and "Line No.". I have created two fields in "Sales & Receivales Setup" ("End of billing cycle template" and "End of billing cycle batch") having table relation with "Gen. Journal Template" and "Gen. Journal Batch" respectively as shown in fig 2 and fig 3. Now in fig 4 I'm getting the three primary keys; two from "Sales & Receivales setup" and one using .GetNewLineNo. method present in "Gen, Journal Line" table. Now the thing is that when I post the values they are not added to the "Payment Journal" new line. The reason is shown in fig 1 and fig 5, in fig 5 the line no. for first line is 10000 and for second line it should be 20000 but in fig 1 the line no. I'm getting is 210000. The reason behind this is that I have run this multiple time so the line no. started from 20000 has become now 210000. Now can anyone tell me that how can I start from line no. 20000.

 pastedimage1672217266704v1.png

pastedimage1672221670614v6.png

pastedimage1672217505754v4.png

pastedimage1672217478148v3.png

pastedimage1672217303531v2.png

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: Line No. Issue in Payment Journal

    yes, it will always find the last Line No. in that batch and increment from there.

  • RE: Line No. Issue in Payment Journal

    Thanks mohana I have checked it and it is working properly.

  • RE: Line No. Issue in Payment Journal

    The Line no. in CASH Batch was increased alot.

    One thing more I want to ask is that for e.g. If I execute the entire procedure with the same Batch name on both pages, the Line no. I'll get will be 20000 right? and after appending the values in the next line in the "Payment Journal" I post. And if I again repeat the entire procedure, the Line No. that I'll get will be 20000 or 30000? because if I get 30000 that means that the Line No. is increasing and the values will not be shown in the next line and I'll face the same issue as I was facing right now. If I get 20000 then it will be entirely right. Kindly tell me what will happen?

  • RE: Line No. Issue in Payment Journal

    Yes mohana you are right both are different. When I changed batch name in "Sales & Receivales setup" to BANK, it worked and values are appending in the next line. Before I was doing it for CASH and seeing it on BANK that's why the line no. was increasing and increasing as I was not also deleting it.

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: Line No. Issue in Payment Journal

    Check the last Line No. of CASH batch.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,194 Super User 2024 Season 2 on at
    RE: Line No. Issue in Payment Journal

    Looks like in fig2. you have selected batch as CASH where as you are using BANK in fig5.

    Is it correct?

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans