Treeview for a custom doctype

I have created a new Doctype and i want to display it as a treeview like a Account Doctype with a filter Doctype like company in Account Doctype , where i can load this filter data.

Revant had a tutorial for this, try searching the forum for it.