6 Replies Latest reply on Jan 8, 2015 8:53 AM by Heather_Pennington

    Why is my script not calculating?

    Heather_Pennington

      The first event is calculating correctly, but the second event is not.  What is wrong with the script?

       

      var A  = Number(this.getField("OriginalAwardedBid").value);

      var B  = Number(this.getField("NegFinalPrice").value);

      var C  = Number(this.getField("CurrentVolume").value);

      var D  = Number(this.getField("Department").value);

      var E  = Number(this.getField("Ttl Proj Original Bid").value);

      var F  = Number(this.getField("Ttl Proj Final Neg Price").value);                                            

       

       

      if ((D== "Field Sourcing", "National Warehouse", "Purchasing") && (A != 0) && (B != 0) && (C != 0))

      {

           event.value = (A*C)-(B*C);}

       

       

      else

      if((D=="Category Management") && (E !=0) && (F !=0))

      {

           event.value = (E-F);}

       

       

      else

      {event.value = "0.00";}