Function to generate restarting sequential number for each document number

8 posts / 0 new
Last post
Angelo
Offline
Joined: 02/12/2021 - 09:33
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. :)

Images: 
Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

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
Offline
Joined: 02/12/2021 - 09:33

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. 

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Angelo, you want to try out this script and see if it fits your needs.

Angelo
Offline
Joined: 02/12/2021 - 09:33

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

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

Hi Angelo,

I just posted a video on how to do this.  Let me know if you have any questions.

https://www.youtube.com/watch?v=Vz5hmFwKw4c

Angelo
Offline
Joined: 02/12/2021 - 09:33

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

Brian Element's picture
Brian Element
Offline
Joined: 07/11/2012 - 19:57

You are welcome Angelo, good look with your project.