Mandatory if other field is not blank

Hi! In customizing doctypes, how do I make a field mandatory if another field is not blank? Is there a script I can type here in Mandatory Depends On (JS)? The code below doesn’t seem to work.

Field Name: completed_by

image

1 Like

Hi @mehmehly

Try This Condition

eval: doc.completed_by != "";

I hope It’s Working
Thank You!

You can try this Condition

eval: !doc.completed_by 

Thank You!

Unfortunately, this doesn’t work :smiling_face_with_tear:

Unfortunately this doesn’t work as well :smiling_face_with_tear:

It should only be mandatory if another field is not empty