Formula Builder - check for multiple conditions

I want to check for multiple conditions in a formula - this is what I have tried

equal($sales_stage,"Sale Closed- Lost")
and
greaterThan(strlen($lostreason1_c),0)
and
greaterThan(strlen($lostreason2_c),0)
and
greaterThan(strlen($lostreason3_c),0)

but I get this error

equal: Syntax Error (Improperly Terminated String ') and greaterThan(strlen($lostreason1_c)')32 72

  • Hello,

    the syntax will be more like

    Fullscreen
    1
    AND(equal($sales_stage,"Sale Closed- Lost"),greaterThan(strlen($lostreason1_c),0),greaterThan(strlen($lostreason2_c),0),greaterThan(strlen($lostreason3_c),0))
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Fred

  • Hi Fred

    This gives an error

    AND: No such function defined

    Is there somewhere in Sugars docs where I can find these functions - the information I can find is very limited to simple single functions

  • Hi  ,

    The formula builder is case sensitive, so the formula  provided is accurate with one minor change:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    and(
    equal(
    $sales_stage,
    "Sale Closed- Lost"
    ),
    greaterThan(
    strlen($lostreason1_c),
    0
    ),
    greaterThan(
    strlen($lostreason2_c),
    0
    ),
    greaterThan(
    strlen($lostreason3_c),
    0
    )
    )
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    All the Sugar Logic functions available in the application are documented in the Administration Guide for your edition and version of Sugar. 

    Chris