Skip to main content
13-Aquamarine
May 15, 2024
Question

Autogenerated numbers skiiping few numbers while creating new objctct and increments also on error.

  • May 15, 2024
  • 1 reply
  • 1363 views

Hi everyone ,

I have custom form processor that create new WTPart from create wizard of  Document and number of part is same as document , so i have custom numbering schema in my customised OIR that gives me  editable generated number on wizard but problem is in preProcess() method it skips the few number while creating new Part which i don't want part number should be same as document number and one more condition is if i edit the number filed and the wrong numbers then i handeld the exception which helps me to do not create document but in this case in backend it autogenerates the number and increments that on error also which shoul be prevented ,
So how can we prevent the skiiping of number and increamenting of number on error using java code

1 reply

avillanueva
23-Emerald I
23-Emerald I
May 15, 2024

Is this using an Oracle sequence?  If so, this is a common problem. A quick google search can yield a ton of articles on this:

https://asktom.oracle.com/ords/asktom.search?tag=sequence-behavior-skipping-values

https://www.ptc.com/en/support/article/CS198446?source=search

I ditched sequences for my CN numbers and opted for a search for latest number and add one. This seems to work in my case. 

18-Opal
May 15, 2024

@avillanueva 

Agreed. I've done the same thing for companies that wanted the CA number the same as the CO number.  And yes, they restricted the number of CAs on a CO to 1. 😁

 

I'm with you, bag the sequence and write one's own logic to determine the number.

 

BTW, this post should really be in the customization board because, well, it is a customization. 😉