Link Doctype to itself is it possible?

hi ,
i want to link Doctype Account to it self
so i can choose docname,and get some fields from that docname i selected via link ?

Yes, you link a doctype recursively. Here’s an example:
The 10th row. Look at it in this screenshot too!


Thank You for the fast comment, i tried it to see the shown_number for the field linked … it show nothing !!!

Check to see if the field is showing (the Parent Account Number), if so,
did you set any value to the Show Number field in the parent account?

1 Like

yes , i set shown_number then i try , could you try it on your erpnext … if it works or not ?

Remember that the system will do the fetch when the Link field changes. In other words, the Link field (Parent Account field) will trigger the fetch. So, you will have to change the value of that field for every child account.

You can see it working on

all i want is to get account parrent shown_number and i get this :

I could replicate your request in my end and it seems that I doesn’t work in the popup window (prompt view). So, you got two options:

  1. Create them and re-set the value of the Parent Account field to trigger the fetch (this will be done in the default view).

  2. Or raise an issue in the repository and wait to for a fix for this.

1 Like

if i only could trigger a sql of inside the account_tree.js file :frowning:

in this line
fields: [
{fieldtype:‘Data’, fieldname:‘parent_account_number’, label:__(‘Parent Account Number’),defualt="the shown number variable "}

thank you so much for your help yefritavarez :heart_eyes:

@geekroot Any thoughts?