How to Search Customer Mobile Number in ERPNext V14

Hi,

I would like to search customer by their contact number saved as Primary Mobile. I cannot do that in top filter of Customer section. I also cannot search customer by mobile number when I create Sales side Document. E.g Quotation, Delivery Note, Sales Invoice.

Customize customer doctype. Edit the field Mobile No and enable ‘In Global Search’

They are already enabled in Customer and in Contact form both.

The above method works only when you add the primary contact to the customer.

in the customization you should now have mobile_no included in search fields

Now you can search a customer in Sales Order with mobile number.

When I try to click on the box “Customer Primary Contact”, I am getting below error

I have version 14.10.1

I tried to create a new customer and I get same error when clicking on Customer Primary Contact.

This is a standard feature and it should work.
Looks like you are trying to fetch or refer to field full name from contact. The error says field ‘Full Name’ is not there in contacts. Check your customizations once again both in contacts and in customer. Remove any references to Full Name. Worst case, try resetting your customizations both in contacts and customer.

I “reset to defaults” Customer and Contact Customize Form but still I get this error.

Could you please refer to this post. Also check browser console for any errors.

Console show this error

request.js:462 Traceback (most recent call last):
File “apps/frappe/frappe/app.py”, line 69, in application
response = frappe.api.handle()
File “apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “apps/frappe/frappe/handler.py”, line 45, in handle
data = execute_cmd(cmd)
File “apps/frappe/frappe/handler.py”, line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “apps/frappe/frappe/init.py”, line 1590, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/desk/search.py”, line 62, in search_link
search_widget(
File “apps/frappe/frappe/desk/search.py”, line 125, in search_widget
raise e
File “apps/frappe/frappe/desk/search.py”, line 110, in search_widget
frappe.response[“values”] = frappe.call(
File “apps/frappe/frappe/init.py”, line 1590, in call
return fn(*args, **newargs)
File “apps/frappe/frappe/desk/search.py”, line 326, in wrapper
return fn(**kwargs)
File “apps/erpnext/erpnext/selling/doctype/customer/customer.py”, line 745, in get_customer_primary_contact
.run()
File “apps/frappe/frappe/query_builder/utils.py”, line 76, in execute_query
return frappe.db.sql(query, params, *args, **kwargs) # nosemgrep
File “apps/frappe/frappe/database/database.py”, line 218, in sql
self._cursor.execute(query, values)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, “Unknown column ‘tabContact.full_name’ in ‘field list’”)

in Customer - Customize Form.

This is the section which pop the error. The filed customer primary contact does not have any data to fetch from.

Can you also share the JS console log. You can inspect the browser and take the console logs. Something like below

Do you have custom script enabled for customer?
Can you also check doctype customer and all list all the custom fields?

These custom fields are appearing in Customer Doctype

The only one I have created is Customer-customer_name_in_arabic

Here are the console errors


My custom script list is empty

Is this error happening for all customers or only selected customers?
Is the contact doctype working fine without errors if accessed separately?
Looks like your recent customizations we not reverted properly.
Did you enable developer mode by any chance?

In Standard Contacts Doctype Full name is not a field. I am not sure without doing customizations how the field Full name is getting referred.

I am clueless. Maybe somebody in the forum can help

@gsarunk thanks for your all this help

it happens with all the customers and contact doctype working fine. I can create a contact from the customer or directly from the contact.

Sorry i missed to observe this before. Can you share the screen shot of the details of this custom field Customer-customer_name_in_arabic.
Especially the Fetch From Section.

the Fetch from Section is empty in Customer

It definitely needs an investigation into your system.
If you are ok to restore back the customizations, just do a reset to defaults in the customizations of Customer and Contacts and try your Luck :slight_smile: