Announcements
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.
yes, it will always find the last Line No. in that batch and increment from there.
Thanks mohana I have checked it and it is working properly.
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?
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.
Check the last Line No. of CASH batch.
Looks like in fig2. you have selected batch as CASH where as you are using BANK in fig5.
Is it correct?
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156