Formula syntax error, any ideas on where?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Russ
    Senior Member
    • Feb 2022
    • 423

    Formula syntax error, any ideas on where?

    Hey guys, this throws 'Syntax' error, any ideas why? It wasn't before but right now causes formula to halt:

    ifThen(
    pricingPlanMismatchDirection=='Down',
    activePricingPlanAlert='<p><font color="#000000" style="background-color: rgb(255, 156, 0);">Pricing plan mismatch</font></p>';
    );

    ifThen(
    pricingPlanMismatchDirection=='Up',
    activePricingPlanAlert='<p><font color="#000000" style="background-color: rgb(148, 189, 123);">Pricing plan mismatch</font></p>';
    );​


    Thanks
  • dimyy
    Active Community Member
    • Jun 2018
    • 569

    #2
    Code:
    $s1 = string\concatenate('<p><font color="#000000" style="background-color: rgb(255, 156, 0);">Pricing plan mismatch</font></p>');
    
    $s2 = string\concatenate('<p><font color="#000000" style="background-color: rgb(148, 189, 123);">Pricing plan mismatch</font></p>');
    
    ifThen(pricingPlanMismatchDirection=='Down', activePricingPlanAlert=$s1);
    
    ifThen( pricingPlanMismatchDirection=='Up', activePricingPlanAlert= $s2);
    ​
    don't ask why :-)

    Comment

    • yuri
      Member
      • Mar 2014
      • 8440

      #3
      Syntax check is fine when tested on v8.2.5.
      If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

      Comment


      • Russ
        Russ commented
        Editing a comment
        hey, thanks
    • dimyy
      Active Community Member
      • Jun 2018
      • 569

      #4
      Or:

      ifThen(
      pricingPlanMismatchDirection=='Down',
      activePricingPlanAlert=('<p><font color="#000000" style="background-color: rgb(255, 156, 0);">Pricing plan mismatch</font></p>');
      );

      ifThen(
      pricingPlanMismatchDirection=='Up',
      activePricingPlanAlert=('<p><font color="#000000" style="background-color: rgb(148, 189, 123);">Pricing plan mismatch</font></p>');
      );​

      Comment

      • dimyy
        Active Community Member
        • Jun 2018
        • 569

        #5
        8.2.2 - error in sandbox
        Attached Files

        Comment

        • dimyy
          Active Community Member
          • Jun 2018
          • 569

          #6
          With brackets around html code string - all ok
          Attached Files

          Comment

          • dimyy
            Active Community Member
            • Jun 2018
            • 569

            #7
            May be helpfull this error:
            Attached Files

            Comment


            • dimyy
              dimyy commented
              Editing a comment
              Minimal expression with error:
              $s1 = 'c=';

              Without error:
              $s1 = ('c=');
          • Russ
            Senior Member
            • Feb 2022
            • 423

            #8
            dude, thanks!!
            dimyy

            Comment

            • yuri
              Member
              • Mar 2014
              • 8440

              #9
              There was a bug in 8.2 which already is fixed. Maybe it's it.
              If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

              Comment

              Working...