ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Abort Workflow If Condition Not Met


#1

I want to make a field go through workflow (from Pending to Approved) if and only if field A is not null. Is this achievable through field level or need to go through custom script. In both cases, kind-of help will be hugely appreciable. Thank You

This is what I found in my workflow and tried something like

Still No Success. ANy help please


#2

@nikzz I guess your condition is worng.

Could you try :

doc.fumsg1 != undefined


#3

@nikzz, you code should be Python not js, telling that, the appropriated syntax should be

bool(doc.get('fumsg1'))

#4

Not worked…giving error

NameError: name 'bool' is not defined

#5

Throwed error

  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1489, in safe_eval
    return eval(code, eval_globals, eval_locals)
  File "<string>", line 1, in <module>

#6

@nikzz

try

doc.get('fumsg1')

#7

Its quite working but what happened here is. It hides the action button until fumsg field is null. What exactly I want is there should be action button and if fumsg field is empty, give an alert and abort workflow