mirror of
https://github.com/frappe/frappe.git
synced 2026-04-24 01:14:06 -06:00
Page:
Frappe Framework Front End Routing and Document Creation
Pages
(Client Side Scripting)Fetch values from another document
(Client Side Scripting)Fetching child tables
App Development using GitHub
Client Side Scripting Index
Client side scripting(Archive)
Client side scripting
Deprecations
Developer Cheatsheet
Frappe Framework Front End Routing and Document Creation
Frappe Push Notification Client Reference
Frappe Test Record Loading: Startup Sequence
Generating Test Records in Frappe
Home
Installing Frappe ERPNext on MacOS
Migrating to Version 13
Migrating to Version 14
Migrating to nightly version
Migrating to version 15
Migrating to version 16
Pull Request Review Guidelines
Setup MariaDB Server
Setup NFS Server
The Hitchhiker's Guide to Installing Frappe on Linux
The Hitchhiker's Guide to Installing Frappe on Mac OS X
Tree view for custom DocType
Using Desk Modules, Calendar and List View in Frappe Framework
Using Frappe with Amazon RDS (or any other DBaaS)
Using the VSCode Debugger with Frappe
Writing an IntegrationTestCase in Frappe: A Step‐by‐Step Guide
query builder migration
No results
4
Frappe Framework Front End Routing and Document Creation
Tyler Matteson edited this page 2018-10-29 07:42:09 +05:30
There are several helper functions built into the Frappe Framework to help with routing, route discovery and creating new documents.
frappe.set_route()
Used to change the route. Example
frappe.route_options
Used to pass variables to a new page. You will almost always want to end your function by emptying the variable upon completion of your method, which is usually on the destination page.Example
frappe.get_route() returns a list of the route variables
| URL | frappe.get_route() output |
|---|---|
| /desk# | [""] |
| /desk#List/Item/List | ["List", "Item", "List"] |
| /desk#Form/Stock%20Settings/Stock%20Settings | ["Form", "Stock Settings", "Stock Settings"] |
frappe.model.make_new_doc_and_get_name("Item");
Works for any (parent) doctype. Example
Although it's not a front end utility, the frappe.model.mapper class is usually a better way to accomplish this.
frappe.route.on("change", function(){... Refactored as of 10/25/18.
Example