How to get sequence number for WT.Part
or Wt.Document
in Windchill through API?
When I create WT.Part
- number automatically generated. But I can not find any method that returns the next number. I'm using Info*Engine
.
At the time of object WTPart
creation windchill use OOTB oracle_seqence in order to auto generate the number.
The sequence name is mentioned in the OIR
of respective object.
Like
For
WTPart
it is : WTPARTID_seq
For
WTDocument
it is : WTDOCUMENTID_seq
etc .
So, if you want to get next number of WTPart
then you can directly call the method wt.fc.PersistenceHelper.manager.getNextSequence("WTPARTID_seq");
from your info*engine task.
For different object the name of the sequence will be different.
In 10.2
PTC introduce another method getCurrentSequence("SEQ_NAME")
to get the current sequence value without incrementing the same.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With