Skip to main content

Function to generate restarting sequential number for each document number

Hello Everyone,
It's my first time in this wonderful IDEA forum.
I'm blocked in my project since I cannot found a function (or other way) to create a sequential number that restart every time the document number changes. In attachment, a screenshot to better understanding.
So,I want that for document number "1310000000" in the column "POSTING_NUMBER" there will be "1" for all related lines; for document number "13100000001" in the column "POSTING_NUMBER" there will be "2" for all lines; and so in an ascending way for next document numbers.
Many thank to whom will help me and sorry for my bad english. :)

Brian Element Fri, 02/12/2021 - 11:43

Hi Angelo and welcome to the site.  

In your case what you are looking for is that for the Posting Number field it would be always 1 for Doc No 131000000, 2 for 1310000001, 3 for 1310000002 and so on? (I didn't bother to make sure all the zeros where there).  So don't how it is shown now?

Angelo Sat, 02/13/2021 - 05:36

Hi Brian, 
Exactly, I would like the result as you said and so posting number 1 for 1310000000, 2 for 130000001 and so on.
I really appreciate your help. 

Angelo Mon, 02/15/2021 - 04:50

Hi Brian, 
Many thanks. Where can I enter the above script? Sorry but I'm new on Idea. 

Angelo Wed, 02/17/2021 - 06:03

Hi Brian,
I really appreciated your availability. Finally, thanks to your script, I was able to do what I wanted.
Many many thanks,
Angelo