Streamline Inventory with Empress’ Auto-Generated Item Codes

Introduction

Welcome to this guide on how to automate the creation of item codes in Empress, based on your own business-specific logic. This feature can be a game-changer for businesses looking to streamline their inventory management processes.

Auto-Generate Item Codes with Custom Logic allows you to create unique codes for each product in your inventory, based on the product’s group and brand. This makes your inventory organized, easier to search, and provides an intuitive understanding of the product just from its code.

How Does This Feature Work?

To implement this feature, you’ll need to add a custom script to the Item section of Empress. This script will run each time you save a new item, ensuring every product gets its unique identifier.

Steps to Implement the Custom Script

Here’s the script you’ll need to add:

cur_frm.cscript.custom_validate = function(doc) {
    doc.item_code = "";
    switch(doc.item_group) {
        case "Test A":
            doc.item_code = "TA";
            break;
        case "Test B":
            doc.item_code = "TB";
            break;
        default:
            doc.item_code = "XX";
    }

    switch(doc.brand) {
        case "Brand A":
            doc.item_code += "BA";
            break;
        case "Brand B":
            doc.item_code += "BB";
            break;
        default:
            doc.item_code += "BX";
    }
}

Let’s break down how this script works:

  1. Clear the Item Code: First, the script clears the existing item_code to make way for the new code.

  2. Assign Group-Based Characters: The script then gives the first two characters of the code based on the item group. If the item belongs to ‘Test A’, the code starts with ‘TA’. If it’s ‘Test B’, the code starts with ‘TB’. For all other groups, it starts with ‘XX’.

  3. Assign Brand-Based Characters: After that, the script adds two more characters to the code based on the brand. If the brand is ‘Brand A’, ‘BA’ is added to the code. If it’s ‘Brand B’, ‘BB’ is added. For all other brands, ‘BX’ is added.

This script should be added to the Custom Script section of the Item in Empress. Remember that the code is case-sensitive, so ensure that the item groups and brands match those specified in the script.

Why Use Auto-Generate Item Codes with Custom Logic?

By introducing this feature into your Empress system, you’re creating a more organized, efficient, and intuitive inventory management system. With unique and informative item codes, you’ll be able to manage your inventory more effectively, and your employees will find it easier to search for and understand the products in your inventory.

For additional resources or support, please visit our Empress Help Center or contact our Support Team.