Q
Problem solve Get help with specific problems with your technologies, process and projects.

# Suppressing zeros in a form

How can I suppress zeros from showing in a number field on a form that is used as a company expense form? The accounting department doesn't want to see zeros when they verify the math after a user has routed the form to them via e-mail. How do you tell Domino you're using a number field, but keep the users from seeing any numbers IF those fields are left blank?

First of all, why does the accounting department need to verify the math? Computers are very good at math. If there's a value on the form that you can calculate for the user, do so and save someone the trouble of checking the value.

Blank is not the same as zero, generally speaking. When the user edits the form, they can enter 0 or leave the field blank. If you would prefer them to leave the field blank if the value is zero, you could enforce that with an input translation formula:

```@If(@ThisValue = 0; ""; @ThisValue)
```
Of course you have to take that into account if you have formulas that do math on these values, with formulas such as:
```total := @If(line1 = ""; 0; line1) + @If(line2 = ""; 0; line2) + ...
```
If you need to preserve the distinction between zero and blank for the original user's sake, but display blanks instead of zeroes when someone else views the form, you can use hide formulas and CFD fields that display the appropriate value to the viewer. For instance, you have a field named WeeklyHours in which the user might enter 0 or leave blank, then you might add a field named WeeklyHours_d on a different paragraph, with a formula such as: `@If(WeeklyHours = 0; ""; WeeklyHours)`

Then you must set hide attributes for the paragraphs containing both fields to make them display in the right circumstances. The easiest path is to make one display in edit mode and one in read mode. But if you need to, you can also choose which to display based on the identity of the user. For example, if you record the original username in the field "Computed when composed" field OriginalAuthor and you want to display the editable field only to that person, then you would use the following hide formulas:

```@UserName != OriginalAuthor -- for the editable field
@UserName = OriginalAuthor -- for the CFD field
```
You can also hide things based on a user's role or group memberships by using the @UserRoles or @UserNamesList functions. However, if you do that, watch out for the following:
• These functions don't work in a local replica unless you enable the "Consistent access control" option in the database ACL dialog.

• Since the functions typically return a multivalue result, be careful using !=. For example, if @UserRoles returns "[Accounting]" : "[Editors]", then the expression `@UserRoles != "[Accounting]"` is TRUE because one of the list members -- [Editors] -- does not equal [Accounting]. Instead use `!(@UserRoles != "[Accounting]")`.

• You may need to take into account that someone in accounting may need to originate one of these documents. Obviously they must then be able to view the fields that you are hiding.

• @UserNamesList and @UserRoles are expensive functions, so you shouldn't evaluate them multiple times on a form. Use a CFD field at the top of the form to find out what you need to know about their identity. Following the example, it might be a number field called IsAccounting, with this formula: `@If(@IsDocBeingLoaded; @ThisValue; @UserRoles = "[Accounting]")`. Thereafter you can use IsEditable in hide formulas instead of calling @UserRoles again.

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Updated Exchange Online PowerShell module adds reliability, speed

Microsoft assists Exchange Online administrators who rely on PowerShell by reworking the underlying functionality of several ...

• ### Mammoth March Patch Tuesday lands on Windows admins

Microsoft delivers corrections for 115 unique vulnerabilities, including 26 bugs rated critical in one of its largest Patch ...

• ### Understanding Windows PowerShell function parameters

Parameters in Windows PowerShell can help admins better customize their functions, leading to improved input testing and more ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### Tech giants aim supercomputers, clouds at finding a COVID-19 cure

The new COVID-19 HPC consortium comprised of tech giants, national labs and academia are using supercomputers and clouds to speed...

• ### Top vendor SDDC certification programs for admins

If you decide to grow your knowledge of software-defined data center technologies, VMware, Nuage Networks and Microsoft offer ...

• ### Build up your knowledge of leaf-spine network technology

As organizations deal with challenges of single tree path networks, many admins are considering leaf-spine architectures. Learn ...

## SearchContentManagement

• ### Vendors offer free remote work technology for telecommuting

It's more than a marketing ploy: Cloud technology vendors, seeing their own issues enabling remote work, extend paid products to ...

• ### How businesses should deal with enterprise search issues

Enterprise search issues frequently complicate user experience with ECM systems. While users may face many problems, they also ...

• ### Box, Dropbox shore up clouds; Box-Microsoft integrations go live

Online document collaboration platforms Box and Dropbox shore up cloud bandwidth, security and customer support as remote work ...

Close