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...
Answered

Line No. Issue in Payment Journal

(0) ShareShare
ReportReport
Posted on by 436

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

I have the same question (0)
  • Verified answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

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

    Is it correct?

  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

    Check the last Line No. of CASH batch.

  • Muhammad Anas Naeemi Profile Picture
    436 on at

    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.

  • Muhammad Anas Naeemi Profile Picture
    436 on at

    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?

  • Muhammad Anas Naeemi Profile Picture
    436 on at

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

  • Suggested answer
    Mohana Yadav Profile Picture
    61,204 Super User 2026 Season 1 on at

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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,926 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,158 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 533 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans