Set Page as standard view for document

I created a page (The “Page” core doctype) that provides a specific view for a doctype.

I would now want to set this view as standard document view, whenever a user opens a document of the respective doctype.

Is such behavior configurable?

Thanks
DoCa

I don’t think this is available out of the box, but you could probably achieve it with a custom script. I’d just redirect when they try to access the doctype list.

Client script: set the “apply to” to “List”. If you’re using your own app for customizations, you probably know how to set the rest of this up.

frappe.listview_settings['Your DocType'] = {
	onload: () => {
		frappe.set_route('your-page')
	}
}

This doesn’t cover alternative views like Report and Calendar that may be implemented for the doctype and it makes it hard to access them if you’re taking away the list view as a navigation base, so adding a button on your page that routes to those views may be appropriate.

1 Like