3 Replies Latest reply on Jul 30, 2016 4:32 AM by Bernd Alheit

    Boolean expressions

    CalicoCat5000

      Hi, I’m trying to get a field to pull information from either one data field or another, the data fields will never have info at the same time.  Will adobe let one field pull info from multiple sources or am I pursuing a fruitless avenue?  First I tried several versions of the following, and the event.value field acts like the second to last line concerning v5 doesn’t exist:

       

      var v1 = this.getField("1Kto50KTotal").value;

      var v2 = this.getField("50Kto100Ktotal").value;

      var v3 = this.getField("100Kto500Ktotal").value;

      var v4 = this.getField("500001andUpTotal").value;

      var v5 = this.getField("FinRevFeeX15%").value;

      var sum = v1 + v2 + v3 + v4

      if (sum < 2000) {event.value = sum;}

      else if (v5 < 2000) {event.value = v5;}

      else {event.value = 2000}

       

      Then I read some more about Boolean expressions and thought I’d found the answer with the Or operator ||, but when I tried the following, I get a message that there is a syntax error in the last line, but I don’t see an error:

      var v1 = this.getField("1Kto50KTotal").value;

      var v2 = this.getField("50Kto100Ktotal").value;

      var v3 = this.getField("100Kto500Ktotal").value;

      var v4 = this.getField("500001andUpTotal").value;

      var v5 = this.getField("FinRevFeeX15%").value;

      var sum = v1 + v2 + v3 + v4

      if (sum < 2000) {event.value = sum;}

      else {event.value = 2000;}

      ||  if (v5 < 2000) {event.value = v5;}

      else {event.value = 2000;}

       

      Could someone point me in the right direction?