How To Change prefix on auto generated Ids (ATG Oracle Commerce)

ATG out of the box provide a mechanism to auto generate ids.

If you have been working with ATG you will know this by now, here are some examples of these Ids

Orders by default are created with prefix o, an order number is o4318732, shipping Groups are with prefix sg i.e. sg3251233.

This configuration can be changed easily updating das_id_generator table.

Let's say that we want to have an order prefix that starts with QAL, this is just matter of do the following update:

update das_id_generator set prefix = 'QAL' where id_space_name = 'order';

Now if we want to change the promotions prefix to be different we just need to do as follows:

update das_id_generator set prefix = 'p' where id_space_name = 'promotion';

This will do change it from promo to p.

As you can see id_space_name does match with the item descriptor type

Note: You will need to restart your server after the update since I do not know if there is a repository that can be used to invalidate the caches for these configurations.

So here are a sample of the records on das_id_generator_table, you can change any item descriptor prefix and suffix to make it work as your business needs, also it works with new item-descriptors, just need to create an entry on this table to make it work, SEED and BATCH_SIZE are used for IdGenerator component located at /atg/dynamo/service/IdGenerator/ oracle documentation is clear on how to use the columns and how to use the component these had not changed since a while so it applies to all versions as far as I have seen.



Comments