If I understand you correctly, I would not use LotusScript at all. Let's say you have a document containing a numeric...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
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:
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.
Dig Deeper on LotusScript
Related Q&A from Cregg Hardwick
A user wants to know if it's possible for LotusScript to read an attachment in a Notes document without first detaching it. Find out our expert's ...continue reading
Learn about different options using LotusScript code and Formula language to customize the principal field of outgoing Lotus Notes email messages.continue reading
Read about merging cells in a Microsoft Word table using LotusScript and an Excel example, along with the thought process that goes along with it.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.