Fetching value from another DocType to display in customised field

@Justin_Lu frappe.db dont exists in client side

Take a look in this discussion, it will provide to you the bases of what do you need Custom script - fetch data