ERPNext Conference 2019* ERPNext.com Blog

TypeError: doclist.get_filters_args is not a function


#1

I’m trying to update some old customizations I inherited that worked for erpnext 10.

In ERPNext11 and ERPNext12 I get the error in the title for the below code:

frappe.listview_settings[‘Sales Invoice’] = {
onload: function(doclist) {

doclist.page.add_inner_button(__(“Export”), function() {
var args = {
cmd: ‘something.something.methodname’,
filters: doclist.get_filters_args()
}
open_url_post(frappe.request.url, args);
});
}
Any ideas?


#2

Upon inspecting and comparing the codebases for frappe 10 branch and 11 it looks like the get_filters_args() method has been deprecated. Instead the method get_filters_for_args() seems to accomplish a similar thing.