How to pass data from a page to a Doctype?

I have a static page that has a button when I click on the button I want it to open a new doctype and get the parameters.

  • I’ve tried using set_route on the page but it says set_route is undefined
  • I’ve used window.location.href but when frappe loads the doctype it strips away the parameters