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

How can a button on a form save a new doc and return a value to the calling code?

I have a form in the Notes Client. A LotusScript button on the form creates a new Notes document object, assigns values to it from the current document and then opens it up in a DialogBox so the user can finish entering information.

I want the dialogbox to pass back to the calling code whether the user clicked ok or cancel. If I use DialogBox default buttons the OK passes a True back, but does NOT save the newly created document. If I use my own OK button to save and close, then a false is passed back to the calling code.

Is there a way to save this newly created document if the user clicks OK and return that value back? I can't pre-save it because the DialogBox needs to be validated.

The easy way to do this is to have the LotusScript code that calls the DialogBox check the return value, and if it's True, that code saves the new document. This should work unless you have a Rich Text field in the dialog (Rich Text is not passed back to the caller of DialogBox).

If you must save the dialog document while the dialog is still open, then your OK button can use the RefreshParentNote command (see RefreshParentNote @Command or Tech Tip: Dialog buttons in Notes 6.x) to update field values for the caller. I think that will make the DialogBox call return True; if not, you can set a field to tell the caller that OK was clicked.

Dig Deeper on LotusScript

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

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

SearchContentManagement

Close