Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Hide Zero Values

Not applicable
In the "Invoice" template that comes with ES the "Amount" fields are blank unless there is a value in "Quantity" or "Unit Price". The only calculation is "Quantity * UnitPrice". How are the zero values hidden? I've looked at every field possible for some kind of hint as to what suppresses the zero values and I cannot find anything. My form that I am working on shows all zeros in the amount column, sure I could use the template but then I wouldn't learn anything.



Thanks in advance
4 Replies
pguerett
Level 10
Level 10
I assume that you are speaking of the Purchase Order sample. The 0 is showing up because you have a calculation on that field.



On the validation pattern (Edit), there is a checkbox that says allow empty. This in turn is firing the calc for the amount field and making it empty as well.
Not applicable
Paul,



Thanks for the quick response, I'm not so sure that we are talking about the same program as I do not have that choice when the field is selected. I am referring to the "Invoice Template" found when setting up a form from the "File" "New". When I select the field my only options under OBJECT are "Field, Value, Binding". Under the "Edit" menu at the top of the screen I do not have a "Validation pattern" This choice is availabe but grayed out on the "Object", "Value" menu due to the field being Calculated Read Only.



Thanks again in advance.
pguerett
Level 10
Level 10
You can get to the validation patterns from the Object/Field palette.
Not applicable
Ermm... may I help?



Do the calculation with Javascript in the amount field:

if (Quantity.rawValue != null && UnitPrice.rawValue != null)

{this.rawValue = Quantity.rawValue * UnitPrice.rawValue}



Hope that helped

Lisa



Edit:

Equivalent for the total Amount:

if (Amount1.rawValue == null && Amount2.rawValue == null ...)

{this.rawValue = null;}

else

{this.rawValue = Amount1.rawValue + Amount2.rawValue ....;}