Autogenerate Item code based on Item department, any idea how?

I have items in retail store that are sorted into different department or categories.

Category 1: Food
Category 2: Drugs
Category 3: Cleaning products
Category 4: Personal care

I would like to have an item code to be generated automatically when adding a new item. However, I am looking to have 5 digit item code, but the first digit is based on the category, while the 4 next ones are based on automated generated from 0001 to 9999.

For example, Banada will be 10001, Apple 10002, Advil 20001, Lysol multi-purpose cleaner 30001, Band-aid 40001

Can you tell me if I am correct:

1- categories are referred as item group in erp next?
2- Item code is generally referred as SKU?
3- Is the autogenerated item code something with naming series?


If anyone can help to instruct me on how to do it in the beginner steps, I would really appreciate your help.

Not sure if it is possible to do this, and if the naming series is linked to which field and do I have to create a new field, and is it linked to item master doctype or item group doctype? Is there a simplier way to do this?

Thanks!

Follow this post

if any query then tag me

1 Like

Wow that’s great!

in my case:

I am stuck at some logic for item code naming series

Do I choose item code, or naming series, or item rgoup? and what is the value?


If Item is in Food category, it has a prefix of 1.

So are:
field = item group
value = Food (i believe I have to manually type it?)
Prefix =1

If the above is true, how do I link this with item code?

Thanks @pra17shant !

kind of logic you have to apply.

Where is this condensed table? I can’t find it, mine only is like this:

When adding new item, the item code is still manual

could i be missing a step @pra17shant ?

Hi @l4cky,

If you have not set the naming series in Stock Setting then set it Please.

Then reload (Ctrl + Shift + R) and check it.

Thank You!

1 Like