AnsweredAssumed Answered

calculation vs. auto-enter calculation best practice

Question asked by johnhorner on Jan 17, 2009
Latest reply on Mar 26, 2010 by johnhorner


calculation vs. auto-enter calculation best practice


i have a general question about when it is better to use a calculation field as opposed to auto entering a calculation.  one specific example is for invoicing which i assume is a very .  a line item on an invoice contains perhaps the quantity, the unit price and a subtotal for that line item which could either be a calculation (subtotal = qty x unit price) or it could be a number field that auto enters the same calculation when either qty or unit price are modified.  a third option would even be to use a script trigger to enter in the calculation whenever one of the other fields was modified (although i think the auto-enter option is preferable in this example as it is embedded in the program an does not require writing a script).  as far as i can tell, it would be advantageous to use the auto-enter method because once the invoice is created, the value in subtotal is unlikely to ever change again and if it is auto-entered, it can be permanently stored and indexed and will speedup finds and sorts.  however, one potential drawback that i can think of, is that i have observed some erratic behavior of the auto-enter option where in some instances (which i can't figure out) it does not always perform the auto-enter calculation as expected when one of the referenced fields is updated.


so i have 2 questions:


1.  which method would be preferable for this particular situation?




2.  is there a general rule of thumb or set of criteria to determine when you would use a calculation field and when you would use auto-enter


any thoughts/recommendations/information would be much appreciated.