I am using select2 library for multi-select and on click of a button I am iterating all the selected values and pushing it to a field one by one using method “frappe.client.insert” and I’m able to do so successfully.
Also what I’m doing is on click of that button, I am redirecting to main list page of that doctype. But what I noticed here is sometimes on redirection to List Page, it automatically refreshes and sometimes it don’t. What I want is on redirection is it refreshes automatically.
Along with that, I’m also having cache issue. After redirection and refresh(on click of refresh button on main page), and then clicking “NEW” the values i selected last time using select2 library is auto selected and same is happening untill and unless I clear cache of browser.
So also want to clear the cache at time of redirection using custom script or any alternate way(js or jquery).
i am using datatable actually and many times it doesn’t gets loaded on click of new untill i refresh the page.
So I thought of clearing the cache on page load but frappe.ui.toolbar.clear_cache() is clearing cache in an infinite loop. Any way to perform the same just for 1 time ?
or any other way to solve the issue of datatable on page load bcoz I’m using onload triggerfor the datatable
I have a dirty solution which refresh all the time when you set_route to list but you always have warning message in console.
try this and let me know if it works. I’ve tried, it worked: frappe.set_route("List", "Other Recommendation",{"":""});