Generate Item Code with my Logic

I want to make sure I upload this custom script correctly. My goal is that ERPNext generate Item Codes based on my logic.

The item code depends on the parent item group. For example, all of the items in the parent item group “ingredients” should have an item code that starts with 1. The remaining 6 digits are a number sequence. So, the first ingredient in the system has item code 1000001 and the second ingredient uploaded to the system is 1000002, etc. How do I adjust the custom script to generate this code automatically?


1 Like

I would suggest that this is something you hire someone to implement (see Frelance Jobs link at the top of the Forum), or you can follow the example you shared and try make the changes yourself. If you’re having trouble with a specific error or getting a specific thing to work, it’s fine to ask on the forum but asking for custom implementation without trying first is too much to ask.