ken bohnenkamp
17th April 2006, 15:15
I have a form field that uses a double domain. It is a value such as 120.33
When this value is entered or defaulted to 0.00 I would like to display it as a
blank. Is this possible to do since it is not a character domain. Any help would be appreciated.

mr_suleyman
17th April 2006, 16:57
Yes it is possible . For example you have field that is name of "field1".
In your program script add followings

field.field1:
check.input:
if field1 = 120.33 then
field1 = 0.00
endif
before.display:
if field1 = 120.33 then
field1 = 0.00
endif

if use check input option it effects the database operations. I mean it inserts '0' value to DB. If you use before.display , real value is 120.33 but end user see that like 0.00
You can user otfer trigers according to your wish.

Good Luck!

ken bohnenkamp
17th April 2006, 17:25
Thanks for your input, but I want the user to see a blank, not 0.00
Is there a way to do that. Remember, the field is a double.

mr_suleyman
17th April 2006, 17:58
Oh. I am sorry, Now I am OKEy. You should do followings
field.field1:
check.input:
if field1 = 120.33 then
field1 = 0.00
attr.echo = 0
else
attr.echo = 1
endif
before.display:
if field1 = 120.33 then
field1 = 0.00
attr.echo = 0
else
attr.echo = 1
endif


Check Defaults of Field properties this echo field shouldn't be checked


Good Luck !!!

shah_bs
17th April 2006, 20:52
If it is permitted by your company's programming standards, you can do as follows:

In the form editor, when you pull up the Maintain Form Fields session by double clicking the amount field:
- Uncheck the 'Link/Dis. Form' flag
- In the field beside that, enter the display format, example "ZZZZZZZZVDZZZZ"

That will achieve what you need.

~Vamsi
17th April 2006, 23:25
Ken,

The function you are looking for I believe is print.const(" ") (http://www.baanboard.com/programmers_manual_baanerp_help_functions_form_and_form_field_operations_print_const).


field.myfield:
after.display:
if myfield = 0 then
print.const(" ")
endif