Customize the Link field as dropdown select

How can I create this:

Instead of this:

The idea is to disallow to user fill some values that doesn’t exist in Link field

You will have to remove “create” permission for the user for that particular doctype. For that, goto Role Permissions Manager and select the doctype name. Then, for the particular role, unselect “Create” checkbox.
Hope this helps.

1 Like

Thank you for your answer, but I don’t properly explain the reasons of this case.
User can fill in this input field unexistable data. I want to give him a choice:

  1. Or you create the new user by Click on the “Create a new Customer”
  2. Or you select the existable Customer from list.

You can notice, that anyway you can fill in this input field something like “jklsjalljfdskajlj”
And continiue to create the doctype

You can try this,
JS File

function getTDSAccountDetails(){
	var qry = "select distinct(customer_name) from `tabCustomer`";{
		method: "Method URL",
		args: {"qry": qry},
		callback: function (getCustomerJainDetail) {
			if (getCustomerJainDetail.message != undefined) {

				options = [];
				for (i = 0; i < getCustomerJainDetail.message.length; i++) {
					options[i]= getCustomerJainDetail.message[i][0];

				cur_frm.set_df_property('fieldName', 'options', options);


Python File:

def dbquery(qry):
		data = frappe.db.sql(qry)

	return data

and make that field as select option instead of Link Field.