Home > Ask the Domino Experts > LotusScript Questions & Answers > Keeping an editable number field blank in a Lotus Notes document
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Keeping an editable number field blank in a Lotus Notes document

Cregg Hardwick EXPERT RESPONSE FROM: Cregg Hardwick

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 08 May 2006
How do I zero suppress, or leave number fields blank if no numbers are entered by the user on a Lotus Notes-based form. I don't know LotusScript very well, but I sure could use your help with this. How do you keep an editable number field blank if no numbers are entered by the user? I want to have it show U.S. dollars only if a value is entered.

>
EXPERT RESPONSE

If I understand you correctly, I would not use LotusScript at all. Let's say you have a document containing a numeric field called "Dollars." You want the field to appear blank (not zero) when the user edits the Lotus Notes document. You could just add an input translation formula to the dollars field like this:

@if(dollars=0;"";dollars);

Of course, this will change the value of the field if the document is saved. However, in Lotus Notes, you should be designing all views, agents, etc., to expect numeric fields to sometimes have a null string value, since that's what Formula language returns when you access an uninitialized field.

But, if that's not possible, you could create a "shadow" editable field and make "dollars" hidden so that "dollars" actually gets updated only if the shadow field is changed.

To detect when a field changes, use another hidden "check" field. Place a hidden, "computed for display" check field at the bottom of the form with its value set to its own name. Then add code (either Formula language or script) to the form's post-recalc event that detects when this check field and your editable shadow field have different values, and sets the dollars field and the check field appropriately.


Do you have comments on this Ask the Expert Q&A? Let us know.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED CONTENT
LotusScript
Modifying LotusScript code for date and time handling
Use DXL utilities for advanced replication settings in Notes
Use LotusScript to create encrypted replicas
Write a LotusScript agent to automate file attachments
Troubleshooting a scheduled agent not running on a Global Notes Architecture (GNA) server
Setting up local replication of a Lotus Notes database for offline employees
Creating a link on an HTML page to a Microsoft Word attachment in a Lotus Notes database
LotusScript to extract and move attachments to a Lotus Notes mailbox or file folder
Copying a rich-text field with attachments to a Lotus Notes document
How to convert Lotus Notes documents to .PDF files

LotusScript
Debug Lotus Notes documents using extracted data
Extracting attachments from a Lotus Notes rich-text field
Programmatically replace the design of Lotus Notes databases
Reading a binary field in an Oracle database with LotusScript
LotusScript equivalent of @Picklist for Lotus Notes
Launch large attachments within an email from a Notes database
How to find files on a hard drive or mapped network with LotusScript
Update the ACL from the Roles view with LotusScript
LotusScript agent moves tagged spam email to junk mail folder
Set a value in a field existing in another Lotus Notes database

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 1999 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts