Announcement

Collapse
No announcement yet.

ifThenElse

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ifThenElse

    Hello all, need some assistance with an ifThenElse formula. I have tried to follow this to the tee https://www.espocrm.com/documentatio...ation/formula/ including the below alternatives. Regardless of what I do, it always returns 7.50.

    traineePayment = always equals 7.50
    traineeNon Payment = always equals 0

    ifThenElse(
    cRTrial=='Trainer Day 1'||'Trainer Day 2'||'Trainer Day 3',
    cRTrainerFee=traineePayment, traineeNonPayment);

    The first I tried was ifThen - ifThen(cRTrial=='Trainer Day 1'||'Trainer Day 2'||'Trainer Day 3',
    cRTrainerFee=7.50) - I have also tried 7.50 in 'quotes' as well as using traineePayment. Here I assume if cRTrial is anything else, it returns nothing but it still returns 7.50.

    Then I tried ifThenElse with the else being 0 and it still returns 7.50 regardless of what cRTrial is equal to.

    Please help, thanks.

    Kind regards

    Taurai

  • #2
    This should do it:

    ifThenElse(cRTrial == 'Trainer Day 1' || cRTrial == 'Trainer Day 2' || cRTrial == 'Trainer Day 3' , cRTrainerFee = traineePayment, cRTrainerFee = traineeNonPayment);
    Last edited by khopper; 01-17-2019, 09:47 PM.

    Comment


    • #3
      Thank you Khopper, it worked a treat . I think I understand the logic now. Thanks again

      Kind regards

      Taurai

      Comment


      • #4
        NonTau you can check all documentation about formulas: https://github.com/espocrm/documenta....md#ifthenelse

        Comment

        Working...
        X