Create Fields Based on Workflows

Hi, I am a newbie to ERPnext.

I am currently looking for a mechanism that can enable me to display fields (custom fields) of a doctype based on workflow states.

Let’s sat I have a Doctype for properties, and my current state is Proposed, I want the doctype to show just the fields that i create associated with Proposed and changing the workflow state should be able to take me to the next set of fields.

How can I go around this. Thanks.

On every custom field there’s an field called depends_on and in v-13 reqd_depends_on also…

There you can write js conditions to control the visibility and requirement of each field.

A condition will be like

eval:doc.workflow_state === "Created"


Hi, thanks @max_morais_dmm.

Can you you please more share details where can I find more about these conditions.

Talking about JS conditions, A link or two about learning resource that you feel might help me writing these conditions.

Thanks you.

I think the below link will useful for you.

Also if you can check any core doctype from that you will get more idea how to write that type of conditions.

1 Like