Accounting 2.0  Sales: Exception occurred at Invoice Column Changed Formula …Attempted to divide by zero
Question: I have wrongly keyed in a number in UDF_WIDTH column, and when I removed the number, system prompted message: “Exception occurred at Invoice Column Changed Formula (formula column name =UnitPrice, change column name =dUDF_WIDTH): Attempted to divide by zero.”
Possible Reason:
You have set formula for unit price with ‘divide’ operator. A decimal number divided by zero will become an error.
Solution:
You must key in a figure at WIDTH or edit existing formula.
You may check your formula at AutoCount Management Studio.
1) Login AutoCount Management Studio using Admin ID, go to Tools > Formula.
2) Expand Category: Sales, click on Invoice Detail, then click on Edit Formula.
3) Click on UnitPrice, then click into tab Column Changed.
The formula for UnitPrice is d_UDF_HEIGHT /d_UDF_WIDTH
With this formula, should d_UDF_WIDTH is 0, the formula calculation for UnitPrice will have error, because a decimal number cannot be divided by zero.
4) You may try to change your formula to:
If(d_UDF_WIDTH = 0, 0, d_UDF_HEIGHT/ d_UDF_WIDTH)
Mean that, when UDF_WIDTH is zero, the UnitPrice will be zero too. If UDF_WIDTH is not zero, it will calculate based on the formula d_UDF_HEIGHT/ d_UDF_WIDTH.
5) With the modified formula, when you key in UDF_HEIGHT=80, and UDF_WIDTH=0, system will not prompt the Attempted to divide by zero error, but the Unit Price will be 0. You may key in Unit Price manually.
If you key in UDF_HEIGHT=80, and UDF_WIDTH=10, Unit Price will automatically show 8.
By: Park Yao 230517, Lay Swan 230525, P230529
AutoCount Accounting 2.0 & 2.1

AutoCount Accounting 1.8 / 1.9

AutoCount Payroll

AutoCount POS

AutoCount On The Go

AutoCount Accounting PlugIn Documentations
