boolean validator on create

Issue #398 resolved
Saida Aslanova created an issue

Hi, can you please advice how to resolve this task. the need is on Create validate issue: if one of "mobile request" values is choosed, the "mobile number" text field must be set. Mobile request is checkboxes field with some values, and for some of them mobile number is required, for others there is no need for it. ex.

1) internet (required) 2) order new one (no need) 3) international line (required) ... x) other (optional)

if customer chooses Internet and Order new one the system must dusplay an error. so how I can set it up? when I write for test: %{Mobile requests} in ("Internet package", "the international line") and length(%{mobile number}) = 13 it returns parse error:

Encountered " "," ", "" at line 1, column 41. Was expecting one of: "+" ... ")" ... "+" ... "+" ... "+" ... "+" ... "+" ... "+" ... ")" ... ")" ... ")"

although in explaining there is : Comparison operators: =, !=, >, >=, < and <=. Operators ~, !~, in, not in, any in and none in can be used with strings, multi-valued fields and lists.

Comments (4)

  1. Fidel Castro Armario repo owner

    String List literals are written with the following syntax:

    ["string1", "string2", "string3", ... "stringN"] 
    

    In your particular case, you should use the following boolean expression:

    %{aaaaa} in ["Internet package", "the international line"] and length(%{bbbbb}) = 13
    

    where aaaaa and bbbbb are custom field codes.

  2. Log in to comment