Auto-Close Alert Box

Hi,
I have written some custom code and that is doing some calculation.
Actually what happens when I select some value from a Select Box, based upon that value it does some calculation and after that it add some rows into a table, but the entire process takes some time. What I want is to show a alert/message box like Please wait… and also I want that the message/alert box should automatically disappear once the process is complete.

Any idea, how can we achieve this?

Regards
Ruchin Sharma

@ruchin78 you can use dialog box inside setTimeout

@JoEz
Any idea how to do that, I really do not have any idea about this.
I really appreciate, if you may help me on that.

Regards
Ruchin Sharma

If you are using ajax call then you can use freeze: true,

e.g.

frappe.call({
	method: "",
	args: {},
	freeze: true,
	freeze_message: "Please wait ..",
	callback: function(r) {
		
	}
});
1 Like

@Sangram
I really don’t know about ajax call but yes, I do call server side functions like this.

Regards
Ruchin Sharma

If you are doing with frappe call then use above syntax. It freezes screen with freeze_message until the operation is completed.

@Sangram
Let me hands-on it.

Regards
Ruchin Sharma

Is it possible to write a custom script client-side that automatically closes pop-up alert/dialog boxes in ERPNext?