Generate sequential Unique ID for property without any prefix

Hi All,

I have a requirement to generate unique ID for one of the property in Case which should be increased by one on creating every new case. Please help me with the steps to generate unique Id for a property which should be sequential for every case creation.

For ex: On first case, it should be 100 and on next case it should be 101

Thanks,

Nirmala J

@NirmalaJ2240 Please see support article Case IDs increase daily by 1000 (SA-103704)

Also review SA-60811 :

You can manually reset PYLASTRESERVEDID values in the PC_DATA_UNIQUEID table for a number of impacted object IDs to the correct values for the corresponding objects.

You can also consider using the Market Place “Unique ID Generator for Pega Cases” :

Unique ID Generator for Pega Cases | Pega

The use of 'idGenerator/defaultBatchSize ’ is documented here:

Case ID generation mechanism | Support Center

Pegasystems Documentation

You can disable it with the DSS setting or just keep it, which is what we recommend since it increases performance.

If you set the batchsize to be 1, then you’d get performance comparable to the legacy ID generation. We suggest clients to make a decision based on their usage, do you want performance for ID generation? Are you creating thousands of cases an hour? Then stick with higher value of batch size. If performance is not important to you then set batchsize to a small number.

The best practice here is to ignore IDs or the sequence in which IDs are generated. Clients should not rely on a smaller ID to indicate a case that was created prior to a case with higher ID. If client takes this advice, then there’s no need to set batchsize to 1; keep it at the default value of 1000

If you want the batch size to differ with case type, you could create another Dynamic System Settings (ex. idGenerator/P-/batchSize).

In a multi application environment, caseId generation depends upon database rather than application. For example, if we have two application namely App1 and App2 with case types as CTApp1 and CTApp2 respectively with same case prefix as ‘P’, the case ID’s being generated at App1 will be P-1001, P-1002 and in App2 will be P-1003 , P-1004 and so on, which explain that caseID generation depends on database rather than application.

Please see this documentation:

Hi @MarijeSchillern,

Thanks for sharing detailed explanation. It is working.

What should be done in order to create unique sequential number starting from 1000 or five digit number instead of 1?

Thanks,

Nirmala J

@NirmalaJ2240 Hi,

  1. Use @pzGenerateUniqueID(tools, “prefix_here”), to increment from 1. (A-3)
  2. Then from this, use WhatComes function after “-” (3)
  3. From that add require number, (103, if the no is 100)

And also this this will help u to get the random number but not sequential, round(random(min,max))

@MarijeSchillern Hi, do we have any OOTB Pega Rest API exposed for this unique ID generator ? I want to use this for Payment Reference ID ,if possible.

Regards,

Gaurav Kumar Tyagi

Hi @GAURAVTYAGI.

REST API documentation can be found here and here. There are some further details in the discussion How to get the next auto-increment ID in Pega

As this thread is closed and your question is different could I suggest to you that you Ask a New Question?