0 Replies Latest reply on Sep 11, 2013 9:58 AM by Shannon.Plimmer

    Calculations Question

    Shannon.Plimmer

      I'm hoping someone can guide me in the right direction...

       

      I have a form that calculates the "MarkUp" of an item based on "NetSell" and "TotalCost" (see formula below):

       

      // Custom Calculate script for MarkUp

      (function () {

       

          var v1 = +getField("NetSell").value;

          var v2 = +getField("TotalCost").value;

          event.value = v2 !== 0 ? v1 / v2 : "";

       

      })();

       

      This works well.

       

      However, I've been asked to produce a calculation that would allow the person completing the form to enter a MarkUp on the form and then, based on that value, calculate the "NetSell" (formula: SellPrice*(1-CustDisc)).

       

      Additionally, it would be nice if I could produce a calculation that would allow the person completing the form to enter the "NetSell" (formula: SellPrice*(1-CustDisc)) and then, based on that value, calculate the MarkUp.

       

      I'm not familiar enough with JavaScript to conditionally format these formulas to do multiple calculations based on data entered.

       

      Any help would be immensely appreciated!