Return to doctype

maybe someone knows how to make the doctype return to a previous one, for example in the Purchase invoice when I put create new Supplier goes to the doctype of the Supplier and when saving this, it returns to the doctype of the Purchase Invoice.
That’s what I want to do, someone knows?

Hello @Danny_Gallegos,

Can you share more details + snapshot ? I did’t understand your question. What you want to do ?


Hello, thanks for answering

When I am in doctype A, and in a link field of toctype B I want to create a new doctype, it is changed to doctype B, and at the moment I save the doctype B it automatically returns to the doctype A … that event is the one that I need

Hello @Danny_Gallegos,

You have to use linked field for ref doc type A to B. If you have changed data doc type B that time
automatically changed doc type A.


I’m kind of new in ERPNext, but not sure if @Solufy answered the question.

I’ll try to rephrase @Danny_Gallegos question because yesterday I was testing Project Management and find a similar problem.

I was creating a new project. Within the “New Project” window (doctype A) I tried to create a “New Customer” (doctype B).

Inside the “Customer Field” in the “Project Window”, there is an option to create a new customer. If I click that option, the “New Customer” window is opened, leaving the “Project Window”.

From here I can create the customer. But after saving it, instead of returning to the “New Project” window, it stayed at “Customer Window”.

Ideally, it should return to the “Project Windows” (with previous unsaved data).

Although I’m talking about project doctype, its the same problem described in the original question (doctype A and B)

Is there a way for ERPNext to behave in this way?


@Solufy, @abenavides is detailing the problem more clearly and we are looking for the code that makes that Doctype change