Getting "Search Fields should contain valid fieldnames" message for Cost Center doctype

Hi There,

I am getting “Search Fields should contain valid fieldnames” message when I click on Update on Customize Form page for Cost Center doctype. I did create an issue Bug : Search Fields should contain valid fieldnames · Issue #2441 · frappe/erpnext · GitHub but didn’t get a valid response. In search field, it has “name,parent_cost_center”. In web console log it has:
"“Traceback (innermost last):
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 49, in application
response = frappe.handler.handle()
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 66, in handle
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 89, in execute_cmd
ret =, **frappe.form_dict)
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 531, in call
return fn(*args, **newargs)
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 19, in runserverobj
frappe.widgets.form.run_method.runserverobj(method, docs=docs, dt=dt, dn=dn, arg=arg, args=args)
File “/home/doris/frappe-bench/apps/frappe/frappe/widgets/form/”, line 35, in runserverobj
r = doc.run_method(method)
File “/home/doris/frappe-bench/apps/frappe/frappe/model/”, line 412, in run_method
return Document.hook(fn)(self, *args, **kwargs)
File “/home/doris/frappe-bench/apps/frappe/frappe/model/”, line 493, in composer
return composed(self, method, *args, **kwargs)
File “/home/doris/frappe-bench/apps/frappe/frappe/model/”, line 476, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/doris/frappe-bench/apps/frappe/frappe/model/”, line 406, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/doris/frappe-bench/apps/frappe/frappe/core/doctype/customize_form/”, line 93, in save_customization
File “/home/doris/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 178, in validate_fields_for_doctype
File “/home/doris/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 280, in validate_fields
File “/home/doris/frappe-bench/apps/frappe/frappe/core/doctype/doctype/”, line 262, in check_search_fields
frappe.throw(_(“Search Fields should contain valid fieldnames”))
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 202, in throw
msgprint(msg, raise_exception=exc)
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 199, in msgprint
File “/home/doris/frappe-bench/apps/frappe/frappe/”, line 183, in _raise_exception
raise raise_exception, msg
ValidationError: Search Fields should contain valid fieldnames”

Please help to rectify this. Because of this I am not able to set permission for Cost Center doc type.

Kind regards,

Check the “Search Fields” property in your Cost Center DocType (or via Customize Form View) if you have customized. One of the fields is no longer a fieldname.


I would like to add the ‘parent’ in search field, but getting similar error.
parent column is there in table but not in doctype, so i can’t add it, isn’t it?