CoreBOSBB

Full Version: Expressions: multiple conditions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Follow the previous post I created a validation map that evaluates a condition expression map. I want to trigger the validation only when a certain picklist value is selected, so
Code:
if (pending_tc_recordcount > 0 && lm_status = 'thetriggeringstatus') then 0 else 1 end
But that doesn't yield the desired result (I get some fatal error). Is this even possible and if so, how? And if it's not, is there another solution, other than writing a custom validation?
Try with

if AND(pending_tc_recordcount > 0, lm_status = 'thetriggeringstatus') then 0 else 1 end
Sadly, that also leads to a fatal error
Code:
Uncaught Exception: Was expecting a closing bracket in /PATH/public_html/rolodek/CRM/modules/com_vtiger_workflow/expression_engine/VTParser.inc:136
try it in the workflow editor, make sure the expression works there and then copy it to the map. note the in XML you may have to use CDATA for the bigger and lesser than operators (I don't remember)
or try with >
in short: this works, I have seen it a lot before
The solution was

if AND(pending_tc_recordcount > 0, lm_status == 'thetriggeringstatus') then 0 else 1 end

Mind the double equals sign. Damn expression language tripped me up again.
Sorry, for that, but very happy it worked!
No problem, just glad I got it to work