ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Error on Workflow Update


#1

I am having this issue on workflow update:

desk.min.js?ver=1537156365.0:7029 Uncaught TypeError: Cannot read property ‘next_state’ of undefined
at Object.get_next_state (desk.min.js?ver=1537156365.0:7029)
at HTMLAnchorElement. (form.min.js?ver=1537156365.0:4242)
at HTMLAnchorElement.dispatch (jquery.min.js:3)
at HTMLAnchorElement.$event.dispatch (report.min.js?ver=1537156365.0:3031)
at HTMLAnchorElement.r.handle (jquery.min.js:3)

Then, the process hangs but continues after 50 seconds. I don’t know what causes the issue.


#2

Cannot read property ‘next_state’ of undefined

next_state is a property of the rows you defined in Transitions i.e. where you define On State S1, when you do Action A doc goes to State S2

I think there is an issue with the current action you took on a certain state. It is not able to read the next state. Check if all the states have been correctly defined.


#3

I can’t find any issue on my Transition Rules. It goes like this:

State Action Next State Allowed
New Endorse to Approver For Approval 1 All
For Approval 1 Amend New All
For Approval 1 Approve and Endorse to Accounting Endorsed to Payables Level 1 Approver
For Approval 1 Approve and Endorse to Next Approver For Approval 2 Level 1 Approver
For Approval 1 Disapprove Disapproved Level 1 Approver
For Approval 2 Approve and Endorse to Accounting Endorsed to Payables Level 2 Approver
For Approval 2 Approve and Endorse to Next Approver For Approval 3 Level 2 Approver
For Approval 2 Disapprove Disapproved Level 2 Approver
For Approval 2 Amend New All
For Approval 3 Approve and Endorse to Accounting Endorsed to Payables Level 3 Approver
For Approval 3 Disapprove Disapproved Level 3 Approver
For Approval 3 Amend New All
For Approval 1 Endorse for Auto Debit For Auto Debit Level 1 Approver
For Approval 2 Endorse for Auto Debit For Auto Debit Level 2 Approver
For Approval 3 Endorse for Auto Debit For Auto Debit Level 3 Approver
Endorsed to Payables Receive For Payable Process Payables User
Disapproved Amend New All
For Payment Pay Check Printed Treasury User
Endorsed for Payment Receive For Payment Treasury User
Check Printed Release Ready for Release Treasury User
Released Close Closed Treasury User
Disapproved Cancel Cancelled All
Endorsed to Payables Cancel Cancelled Payables User
For Approval 2 Reset Approval For Approval 1 All
For Approval 3 Reset Approval For Approval 1 All
Endorsed to Payables Reset Approval For Approval 1 Payables User
For Payable Process Cancel Cancelled Payables User
For Payable Process Endorse for Payment Endorsed for Payment Payables User
For Auto Debit Endorse to Payables Endorsed to Payables Treasury Manager
For Payment Cancel Cancelled Treasury User
For Payment Reset Approval For Approval 1 Treasury User
Check Printed Approve Ready for Release Treasury User
For Payment Cancel Cancelled Payables User
For Payable Process Reset Approval For Approval 1 Payables User
Endorsed for Payment Reset Approval For Approval 1 Payables User
Ready for Release Receive Released Treasury User
Endorsed for Payment Return For Payable Process Treasury User

#4

On what state was that document and what action did you perform on it ?


#5

It occurs in all state. It is intermittent.


#6

Is this state already defined in the previous States table ? What happens if you replace it by Draft state ( in both States and Transition tables)


#7

Error is the same after changing all New to Draft.


#8

Seems like the issue here is loading of the objects of Workflow. If you click it again and wait for a minute, it will proceed. How can I possibly solve that?


#9

Have you been facing any issues with server performance like slowing down or something ?

However, it may not be a server performance issue but rather the JS response issue. Have you seen if a smaller workflow gives better response. Depending on the error you posted it seemed that some state definition was missing.


#10

We have another Doctype with smaller Workflow and no error on that.