How clear cache on load

Is there any way to clear cache via javascrip


Try, frappe.ui.toolbar.clear_cache() to clear cache via javascript

@makarand_b thanks but is not working with my requirement

my requirement is when i submit a doctype xyz i wrote a code for updating value of field abc in doctype mno

and i is updating sucessfully but it when go to doctype mno i was getiing a non updated but when i refresh i will get updated value

can u help me to find the better solution

Hello @shahid_ecit,

You can you location.reload(); to reload form view.
reload will automatically clear the cache.



but when i use location.reload on onload or refresh browser get refreshes infinitly

Hello @shahid_ecit,

Here is the example:

frappe.ui.form.on(‘Delivery Note’, {
on_submit: function(frm) {

for more clarification, can you share the code here?

Please tell me how to make the page refresh before opening the document?

found the solution myself, added custom script:

frappe.ui.form.on(‘doctype_custom’, {
refresh(frm) {
frappe.ui.form.on (‘Stock Entry’, {
refresh:function (frm) {
location.reload ();