From main topic, user composes a response document.
Just after the response is composed and inherits values from the main
topic, I need to close the parent document window. Can this be done?
Reason being, I'm changing some values on the parent from the response.
The user must be forced to reload the main topic, otherwise he could
compose further response docs which inherit incorrect and outdated values.
Thanks for any help!
Brian
---8<----------------
Dim ws as New NotesUIWorkspace
Dim UIDoc1 as NotesUIDocument
Dim UIDoc2 as NotesUIDocument
Set UIDOC1 = WS.Currentdocument
Set UIDoc2 = WS.ComposeDocument ("","","ANYFORM")
UIDOC1.Document.Field1 = "value"
UIDOC1.Close
----8<-------------------
Because you used the composedocument, a document will open and become
active. Because you use LotusScript, you can still actively control the
parent document and close it. You may want to save the whole bunch before
closing to avoid any 'do you really want to shave' errors ...
--
beyon...@geocities.com
US: http://www.geocities.com/sunsetstrip/alley/8102
Euro: http://artemis.Arcadis.be/beyond_cool
Brian Green <btg...@mindspring.com> wrote in article
<01bc51d5$27f9d6a0$6198...@lewis.mindspring.com>...
In Globals of the form, Declare uidoc as NotesUIDocument. Then on either
the QueryOpen or PostOpen event (depending on whether it is a new document
or not) add this:
Set uidoc = source 'source is one of the event parameters and is the
current doc.
Now, for you action:
Call workspace.ComposeDocument("", "", "Response")
Call uidoc.Close
Very simple. The problem with our friend's solution (below) is that uidoc1
is set to be the current workspace document. When he composes a new
document, a new window opens, and uidoc1 now refers to this new window, the
workspace's current document- not the original, parent document. Thus
"uidoc1.Close" causes the new window to close, returning you to the
original document. it will appear that nothing has happened.
In my example, "uidoc" refers specifically to the original document, even
after composing a new document.
Good Luck,
Justin Binder
beyond cool <postm...@aol.com> wrote in article
<01bc53e9$190b7d40$0914...@beyond-cool.sitel-be.com>...
I also don't see why you would want to use an EVENT to trigger anything. A
button or anything else will do just fine too ...
Anyway ... My solution worked fine :)
--
beyon...@geocities.com
US: http://www.geocities.com/sunsetstrip/alley/8102
Euro: http://artemis.Arcadis.be/beyond_cool
Justin Binder <Jus...@RegistrySystems.com> wrote in article
<01bc542a$dfe94e60$eaf9...@justin.registrysystems.com>...
How about having the main document "refresh" itself just before you
compose the response. This would at least ensure that the main document
is up to date before composing a response. To make this work, take the
response document out of the Create menu, and have an action button on
the main document form that used @Command([ViewRefreshFields]), followed
by @Command([Compose])
--
-----------------------------------------------+------------------------
(44) "People ask you for criticism, but they | Steve Bateman
only want praise." ~~ Somerset Maughm | steve_...@hp.com
+------------------------
I created an engineering change order database to track change revisions to
each product's bill of materials. It's slick.
The top level document contains:
Product Model name <editable>
Product Description <editable>
BOM table:
Functional Spec, rev, status
Silkscreen, rev, status
Schematic, rev, status
etc.
When a user creates an ECO (engineering change order) they click an action
button located at the top of the BOM.
A document is composed and inherits values from the BOM. This inherited
document is not saved. Instead it allows the user to begin the approval
cycle for changing an item on the BOM. After the form has been complete,
the user clicks a Submit button.
The Submit button creates a document in a separate ECO approval database,
and modifies several fields on the BOM document.
It was important to force the user to close the BOM, or parent document,
since a LotusScript back-end function was updating the document. If the
user were to compose a second response document (ECO) without reopening the
parent (BOM), incorrect values would be inherited since the user just
updated the document.
Although bc's script will function, Justin's was simple and more
manageable.
Notes, Domino, and LotusScript make an incredible product. I just wish
those Domino commercials were easier to understand!
Regards,
btg...@mindspring.com