Fill a drop list with cities depend on country select

I have a dropdown with countries and I need fill another dropdown with the cities of the country selected, but I really have no idea how to make the script, im very new in ERPNext.

There are multiple ways to do this depending on your use case, is your business only targeting cities within Egypt or is it international?
Create a new doctype called “City” with two fields [Country, City]
Country should be a link field which links to the already existing Country doctype
City should be a data field in which you will manually enter later on. Make it the title field as well.
Add new cities for every country you are doing business in.

Customize your Customer doctype or any other doctype you need and add a “Link” field labeled “City” with the id “cust_City” and apply a client script to filter the city based on the country selected. (Search on this forum for client script filter, you will get lots of results)

1 Like