ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Doctype Coding hide and show doctype


hi everyone!

Is it possible to make a doctype that depends on the selected purpose on material request.
As you can see we have 4 purpose in material request we have
Material Transfer
Material Issue
I want to focused on the purposes Material Transfer and Material Issue. i made 2 new doctypes transfer no. and issuance no. I want to make a code if i choose On Material Transfer the transfer no. will only appear and if i choose Material Issue it will hide the transfer no. and pop up the issuance no.
I really need this code. if anybody can guide me to make this code…
Thank you so much


@cpsolution It sounds like you may be mixing up your Frappe terminology, so let me try to clarify:

These sound like docfields not doctypes.

Try putting something like this in the depends_on field of your custom docfields:

eval: (doc.material_request_type == ''Material Transfer")

This will show this field only when the material request type is set to “Material Transfer”. You can repeat or tweak this pattern for Material Issue.


im sorry i got confuse always about the docfields and doctypes…
Thank you