Item Code auto generation

For Reference Document naming series & Document naming rules is responsible to design or generate user specific code check twos DocType.

Your Problem @matthkarl
2. Made two rules: is_sales_item = Yes + item_group = Events

Instead of
is_sales_item = 1
item_group = Events

Make sure item group name same in item group list.
System will check case-sensitive manner wile triggering this.

Hope you understand…!

Thanks. Changing the rule to 1 instead of yes did the trick.
But I guess the naming rule still needs a Prefix, as I can’t save the rule without one.

Done with the below code where gate and globe are custom check boxes. Description-1 and description -2 are custom read only fields.
Gate sub type is custom select field and description is default item description field.

If someone has a better way to put this, let me have your valuable suggestions.

frappe.ui.form.on(‘Item’ , {
validate:function(frm){
frm.set_value(‘description_1’, frm.doc.gate_sub_type + " " + frm.doc.body);

    }

});

frappe.ui.form.on(“Item”,“gate”, function(frm){
if(cur_frm.doc.gate == “1”){
cur_frm.doc.description_2 = “Gate Valve”;
cur_frm.refresh_field(‘description_2’);
} else {
if(cur_frm.doc.gate == “0”){
cur_frm.doc.description_2 = " ";
cur_frm.refresh_field(‘description_2’);
}
}
});

frappe.ui.form.on(“Item”,“globe”, function(frm){
if(cur_frm.doc.globe == “1”){
cur_frm.doc.description_2 = “Globe Valve”;
cur_frm.refresh_field(‘description_2’);
} else {
if(cur_frm.doc.globe == “0”){
cur_frm.doc.description_2 = " ";
cur_frm.refresh_field(‘description_2’);
}
}
});

frappe.ui.form.on(‘Item’ , {
validate:function(frm){
frm.set_value(‘description’, frm.doc.gate_sub_type + " " + frm.doc.body + " " + frm.doc.description_2 );

    }

});