4 Replies Latest reply on Nov 15, 2017 6:36 AM by anom10583639

    PDF if, then statement: need help please!

    anom10583639

      Hello, I need help creating a script to allow me to average two cells, only if one of them is greater than zero. I have the following cells: "TotalRatingUC", "TotalRatingLC", and "Overall Rating". We'll call it the following for simplification: TotalRatingUC=A, TotalRatingLC=B, Overall Rating=C.

       

      So basically, i need C= A+B/2 if B>0. If B=0, i need C=A. I tried going off of other examples i found online, but the script i'm using is giving me an error message of: "SyntaxError:illegal charater 2: at line 3.

       

      I was trying this:

      if (this.getField("TotalRatingLC").value == '0') {
      event.value = (this.getField(“TotalRatingUC”).value
      } else {
      event.value = (this.getField(“TotalRatingUC”).value + (this.getField(“TotalRatingLC).value / 2
      }

       

      Any thoughts? This is literally the last item i need to finish this pdf for my work.

       

      Thanks in advance!