Client Support
cancel

Ways to auto-increment additional fields (i.e. other than record id?)

SOLVED
Go to solution
Highlighted
MatthewWilson
Respected Contributor.

Ways to auto-increment additional fields (i.e. other than record id?)

Hi hive-mind.

 

I have a user who would like to create a field which can auto-increment for each record created.  So let's say it starts with a single letter, then four digits - the field would then start at "W0001", then the next record would have the value "W0002", "W0003" etc.

 

I don't think this is possible, but I thought I'd ask.  The closest I think I can achieve is to apply a format to the field, to enforce the letter-digit-digit-digit layout.

 

Can anyone think of anything better?  Thanks!

 

TRIM 7.1.0, build #1157, Windows 7, 32 bit client, 64 bit server, oracle metadata.

3 REPLIES
Greg Fraser_1
HPE Expert

Re: Ways to auto-increment additional fields (i.e. other than record id?)

I'm sure you can do it, but I doubt there is anything out of the box that automates this process.


**Any opinions expressed in this forum are my own personal opinion and should not be interpreted as an official statement on behalf of Hewlett Packard Enterprise**
EWillsey
Acclaimed Contributor.
Solution

Re: Ways to auto-increment additional fields (i.e. other than record id?)

I actually just did this for a customer a month or so ago.  For them it was part of a process where nominated users around the world would create a specific type of record.  Since HP TRIM/RM doesn't do this out of the box I had to handle it with code.

 

For them I implemented a larger "automatic numbering pattern" feature.  Users would pick from a type of pattern and once it was saved, my custom code would generate the next available number.  Since this was world-wide some care had to be taken with regard to transactional commits to the system.  I had to always ensure there was a lock on the given pattern before I fetched the last number, then I incremented it, saved the increment back into HP RM, and then placed it onto the record.  I did this with the COM SDK, but the same process can apply to the .Net SDK.  Without such an approach you cannot guarantee concurrency within that field.

 

It's worth noting I did this in a separate field.  I did not use it within the record number or another stock property.  Seems to work well thus far!

 

I hope this help.

 

Cheers,

Erik

MatthewWilson
Respected Contributor.

Re: Ways to auto-increment additional fields (i.e. other than record id?)

Thanks EWillsey, that's what I thought. I pondered the COM plugin route but it's a bit unlikely to get the go-ahead at this stage - it's another configuration item. I'll let the business area know.