I have two issues in customer doctype :
- how can i keep customer group field blank by default while adding new customer
- want to hide ‘Disable’ field
I have two issues in customer doctype :
i think this isnt possible. even if you remove the mandatory of this field with customscript, the validate function will throw an error because of missing field…
therefore you can go to customise and set this checkbbox to hidden
Please help me with this
My lead is telling this can be done.Please help. I am new to ERP.
But before you save the new customer, you will add a customer group?
What about customer group name and parent customer group? Can any changes be made in this to solve the issue??
There are 3 posibillities;
2&3 work as customscript, but when you want to save the new customer without a customer_group, the validation function will not work.
Conclusion; you have to set a customer_group.
@Ashutosh_Halape Are you going to add value to customer group field later? I assume you want that if the default ‘All Customer Groups’ and ‘All Territories’ value is selected the document is not saved. If that is so follow the below instructions:
Go to Customize Form
Select Customer in Enter Form Type
Uncheck the field Quick Entry
Go to Custom Script
Select Customer in Doctype
paste the following code, refresh the customer page and you are good to go.
frappe.ui.form.on('Customer', {
validate(frm) {
var doc = cur_frm.doc;
console.log('validated');
if (doc.customer_group=='All Customer Groups'){
frappe.throw('Please select a customer group other than All Customer Groups');
}
if (doc.territory=='All Territories'){
frappe.throw('Please select a territory other than All Territories');
}
}
})
But remember, you can not save a customer without entering any customer group!
ok i’ll see to it
@joelios i have one more problem.It shows customer group = All customer group in quick edit but after clicking on edit full page it shows customer group value as blank by default.how do i show customer group value as blank by default in quick edit .Please help
as far as I know, this is not solvable with a customscript. you have to deactivate the quickentry.
Solved. I made changes in the selling settings.kept default customer group blank.Save and then reload.