Pass arguments from one doc to another through custom client script/custom button

try this.

frappe.ui.form.on('Purchase Order', {
	refresh(frm) {
		frm.add_custom_button(__("Add Follow-up"), function() {
				frappe.route_options = {
					"item_code": "TextCode"
				};
                console.log(frappe.route_options.item_code);
				frappe.set_route("item", "new-item");
			});
	}
});
2 Likes