Problem with get_list

Hi

I’m trying to get a list of all Customers in a client script for doctype Customer:

cur_frm.cscript.custom_validate = function(doc) {

customers = frappe.model.get_list("Customer");

 $.each(customers, function(i,d) {
   msgprint(i.toString() + ": " + d.name)
 });
}

But get_list only returns one, the current one.
What could be wrong?

Here you go:

frappe.call({
	method:"frappe.client.get_list",
	args:{
		doctype:"Customer",
		filters: [
		],
		fields: ["name"]
	},
	callback: function(r) {
		if (r.message) {
			$.each(r.message, function(i,d) {
				console.log(i.toString() + ": " + d.name);
			});
		}
	}
});

You can add more fields you want returned from the Customer table in “fields”.

Thanks!! Works perfectly!