Try ERPNext Buy Support Partners Foundation

Notification condition doc.subject contain "xyz"

how to make condition on notification doc.subject contain “xyz” or doc.subject like “%xyz%”?
i try eval:(doc.subject.indexOf(“Urgent”) !== -1) but can not save, is there any suggestion?


condition%20invalid

possible typo…
!== should be(I think) !=

not "Urgent" in doc.subject

hi, i’ve try change the operator but still invalid
notification%20err1

hi, i’ve tried not “Urgent” in doc.subject but still invalid, i’ve tried “Urgent” in doc.subject also invalid
notification%20err2
notification%20err3

Here you can see in the dialog that you are not using " but and it’s not the same. Be careful with that.

thank you, sorry my mistake, i try to write it all again, but the result still is invalid

notification%20err4
notification%20err5

Try without the “eval:”

it still is invalid
notification%20err6

“substring” in “fullstring” -> work, can be saved, no error.
“substring” in doc.subject -> does not work, error the condition is invalid

notification%20err7

is doc.subject not string?

I don’t know what’s happening, it seems like a bug. But i tested it and you need to know this:

doc.subject and "Urgent" in doc.subject

Anyways, you should test if it evals to True when needed.

I think that it happens because at the “validation” time, the condition is checked with a blank doc, and subject is None

Thank you so much my friend :smile: it works!
hopefully it can work perfectly on production stage.