Need to know how to validate a custom Doctype

I want to create some custom Doctypes that can be validated and that go through different statuses, like the default Doctypes (Production Order for example).

The statuses to which I refer are: Draft, Submitted, Not Started, In Process, Completed, Stopped, Cancelled.

The only statuses that have my custom Doctypes are Draft, Cancelled and Submitted, but the status field has all the options mentioned above. Custom Doctypes also have the option Can be validated checked.

How can I achieve this?

It seems you need workflow

I have tried Workflows several times, but I have not been able to understand it.
I will try again.

What were the problems ? list them down here.

The problem was that I was not clear about what kind of workflow to follow and I did not know very well the behavior of the different actions, but now I think I know how to handle that after many attempts and tests.

I have replicated the Production Order Workflow to my custom Doctype, and now I want to be able to make stock entries, should I do this using Custom Scripts based on the status of the custom Doctype?

@vazdan forget about Production Order’s workflow, they are complicated.
First try to learn it how workflow works in ERPNext.
Create new workflow on custom doctype, like below,

then check the document.
Then try to add or remove actions & states, then you’ll learn how it works.


@root13F The above workflow link is broken. Here is the updated link for the same.

1 Like