2 Replies Latest reply on Oct 25, 2016 1:52 PM by jessicam63354393

    Need help writing javascript

    jessicam63354393

      I need help writing javascript where I am dividing 2 fields and the answer is in a percentage.  I keep getting an error message and I know it is because I need to add javascript telling what to do when the answer is zero, but I am unsure how to do that.  This is what I currently have written in the Calculate tab under custom calculation script:

       

      event.value = this.getField("Division 1 - 1").value / this.getField("Grand Total 1").value

       

      and in the Format tab I have the category set to percentage.

       

      The error I get is "The value does not match the format of the field"

       

      Any help is much appreciated!  Thank you!!!