Add Custom Script to all DocTypes

Yes, you can.
Add and build a js script with below codes in public js folder of your application :

$(document).on('app_ready', function() {
	$.each(["Opportunity", "Quotation", "Supplier Quotation", 
		"Sales Invoice", "Delivery Note",  "Sales Order",
		"Purchase Invoice", "Purchase Receipt", "Purchase Order"], function(i, doctype) {
		frappe.ui.form.on(doctype, "setup", function(frm) {
			// code for setup event
		});
		frappe.ui.form.on(doctype, "refresh", function(frm) {
                     // code for refresh event
		});
	});
});
6 Likes