February 22, 2023, 5:46pm
I am new to ERPNEXT and I wanted to set the Item code to be auto-generated as per the below scenario.
I have created an “Item Type” with the type - “Select” with the below data
when the user selects say “Finished Goods” I want the Item code to auto-generated as FG000001 with incremental value, if they select “Services” it should be SCG0000001 and if they select “Raw Material” it should autogenerate RW000001.
please guide me. i was going through the forum, but was unable to find the right solution.
February 22, 2023, 5:55pm
You need to create one more field of short code like FG for finished goods. User will set this field before saving. In naming series you have to use filed_name. for auto numbering.
February 22, 2023, 6:05pm
Thank you so much Muzzy, please show me an example with a screenshot.
February 22, 2023, 7:37pm
In Item Group Tree make a new custom field like the one on the right. Set FG, SCG etc. for each
In naming series Item use the code as below. There’s a dot between abbr and ###. Keep the dot and add number of ####. If 4 # then your item code will have max four digits. Use your field name.
System generated item code using naming series.
February 23, 2023, 3:30pm
for this use case, you can use Document Naming Rule where you can Define the Item Type Wise Naming.
February 24, 2023, 4:57am
Thank you so much Muzzy,let me give it a try and get back to you.
February 24, 2023, 4:58am
Thank you Ranbir, if you can please show me an example with a screenshot.
February 24, 2023, 5:13am
Sure, here is a Example with Screenshot.
Use case - If Item Group = Raw Material, then New Item Code Generate as RM-0001.
you can also manage the Document counter in future if you want to reset.
February 24, 2023, 5:34am
Thank you, I did try and was able to create multiple naming rules for each options in the group, but they are not appearing in the item code field when I create a new Item. please help me
Thank you so much santhida, it works like a charm
March 1, 2023, 3:54pm
FYI. It will work only once 1st time at item creation. If you edit the group on item master it will not change. So set it carefully and correctly.