?
Solved

Closing a form after composing a form

Posted on 2005-03-31
20
Medium Priority
?
233 Views
Last Modified: 2013-12-18
I have a action button that @Command([Compose]; ""; "Reply")
when the new form  opens the original stays open.  I need to close the first form before or after I call the Compose.

Something like this

@Command([Compose]; ""; "Reply")
@Command([FileCloseWindow])

but that did not work
0
Comment
Question by:Jaziar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 6
  • 2
  • +2
20 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13672881
Try:
    @PostedCommand([FileCloseWindow]);
    @Command([Compose]; ""; "Reply")
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13672935
Bro,
I don't think that will work.

Jaziar,
Try this:

In the action button do this:

Field actionbutton:="Yes";
@command([fileclosewindow]);

and in the queryclose give this:

@if(actionbutton !="Yes";@return("");@success);
@Command([Compose]; ""; "Reply")

- Partha
0
 

Author Comment

by:Jaziar
ID: 13674152
Hey Partha can you change the formula to script?  My querysave already has a script in it
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Expert Comment

by:p_partha
ID: 13674155
not querysave , it's queryclose.

Partha
0
 

Author Comment

by:Jaziar
ID: 13674217
oops
0
 

Author Comment

by:Jaziar
ID: 13674369
Ooops I have stuff there too

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
      
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim pDoc As NotesDocument
      Dim item As NotesItem
      Dim rtItem As NotesRichTextItem
      Stop
      If Not Source.EditMode Then
            Exit Sub
      End If
      
      Set doc = Source.Document
      If doc.BeenSaved(0) >< "1" Then
            Exit Sub
      End If
      
      Set db = session.CurrentDatabase
      
      Set pDoc = db.GetDocumentByUNID(doc.ParentDocumentUNID)
      
      Set item = pDoc.GetFirstItem("Responses")
      If Not(item.Contains(doc.UniversalID)) Then
          ' This response hasn't been done yet.
            Call item.AppendToTextList(doc.UniversalID)
            Set rtItem = pDoc.GetFirstItem("Comments")
            Call rtItem.AppendDocLink(doc, "Link to " & doc.RequestRequester(0) & "'s Reply")
            Call rtItem.AppendText("   (" & doc.Creator(0) & ")  " & doc.Answer(0))
            Call rtItem.AddNewLine(1)
            Call pDoc.Save(True, False)
            Dim mDoc As NotesDocument
            Set mDoc = New NotesDocument(db)
            mDoc.Form = "Memo"
            mDoc.SendTo = pDoc.RequestRequester(0)     ' Or whatever field it is you have on Form 1 to capture the name of who made it
            mDoc.Subject = "Response to " & pDoc.Subject(0)     ' Or whatever field you have that would be more descriptive
            Set rtItem = New NotesRichTextItem(mDoc, "Body")
            Call rtItem.AppendText(session.CommonUserName & " has responded")
            Call rtItem.AddNewLine(1)
            Call rtItem.AppendDocLink(doc, "Link to the response")
            Call mDoc.Send(False)
            
      End If
End Sub
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13674394
Create a field by name action button and in the view action , just give this:

Field actionbutton:="Yes";
@command([fileclosewindow]);


and modify the queryclose to

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
       Dim workspace As New NotesUIWorkspace
 
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim doc As NotesDocument
     Dim pDoc As NotesDocument
     Dim item As NotesItem
     Dim rtItem As NotesRichTextItem
     Stop
     If Not Source.EditMode Then
          Exit Sub
     End If
     
     Set doc = Source.Document
     If doc.BeenSaved(0) >< "1" Then
          Exit Sub
     End If
     
     Set db = session.CurrentDatabase
     
     Set pDoc = db.GetDocumentByUNID(doc.ParentDocumentUNID)
     
     Set item = pDoc.GetFirstItem("Responses")
     If Not(item.Contains(doc.UniversalID)) Then
          ' This response hasn't been done yet.
          Call item.AppendToTextList(doc.UniversalID)
          Set rtItem = pDoc.GetFirstItem("Comments")
          Call rtItem.AppendDocLink(doc, "Link to " & doc.RequestRequester(0) & "'s Reply")
          Call rtItem.AppendText("   (" & doc.Creator(0) & ")  " & doc.Answer(0))
          Call rtItem.AddNewLine(1)
          Call pDoc.Save(True, False)
          Dim mDoc As NotesDocument
          Set mDoc = New NotesDocument(db)
          mDoc.Form = "Memo"
          mDoc.SendTo = pDoc.RequestRequester(0)     ' Or whatever field it is you have on Form 1 to capture the name of who made it
          mDoc.Subject = "Response to " & pDoc.Subject(0)     ' Or whatever field you have that would be more descriptive
          Set rtItem = New NotesRichTextItem(mDoc, "Body")
          Call rtItem.AppendText(session.CommonUserName & " has responded")
          Call rtItem.AddNewLine(1)
          Call rtItem.AppendDocLink(doc, "Link to the response")
          Call mDoc.Send(False)
         
     End If
if source.fieldgettext("actionbutton") = "Yes" then
 Call workspace.ComposeDocument( "", "", "Reply" )
end if
End Sub
0
 

Author Comment

by:Jaziar
ID: 13674742
Closes the window but the reply form nevers opens - Not sure it matters but the action button is in a form not a view
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13674813
msgbox source.fieldgettext("actionbutton")  and check whether it's Yes

partha
0
 

Author Comment

by:Jaziar
ID: 13674921
I am going to increase the points on this one.  I think I see the problem, but will be hard to explain.

I create a document (form 1) sends a email to a user.  The user opens up the email and sees (form 2) The user clicks start reply (form 3).  Form 3 is now stored in a view as a response document to form1.  I double click the repsonse document in the view and click reply. This is where the (form 4) opens.

On the first pass through form 3 I see the msg box (null) but that is right becuase I have not clicked the reply action.  The second time it closes the form 3 and form 4 never opens nor does the msg box display.  Does it have something to do with this being a exisiting document?

Clear as mud
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13674978
You have to put this in the queryclose of form3.

Partha
0
 

Author Comment

by:Jaziar
ID: 13675215
I did
0
 
LVL 14

Expert Comment

by:p_partha
ID: 13675222
In the debugger, can you check whether the queryclose is executing and what is happening to the messagebox

Thanks
Partha
0
 

Author Comment

by:Jaziar
ID: 13680779
K I will do that after my meeting this morning
0
 
LVL 1

Expert Comment

by:watsonca
ID: 13701650
@Command([Compose]; ""; "Reply")
@PostedCommand([ViewChange]; "3. FormLkup");
@PostedCommand([FileCloseWindow])
0
 

Author Comment

by:Jaziar
ID: 13706360
@PostedCommand([ViewChange]; "3. FormLkup");
 Will not work within a form or document.  This action is being called from inside a response document,
0
 
LVL 1

Expert Comment

by:pbag
ID: 13714203
Use this this will work

@If(@Command([FileCloseWindow]);@PostedCommand([Compose];"ViewForm");"")

Partha
0
 
LVL 1

Accepted Solution

by:
pbag earned 500 total points
ID: 13714209
Use this this will work

@If(@Command([FileCloseWindow]);@PostedCommand([Compose];"Reply");"")

Partha
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13714701
Hi "pbag",

So you say that the posted of my first answer should be moved to the other command... Plausible...

    @PostedCommand([Compose]; ""; "Reply");
    @Command([FileCloseWindow]);
0
 

Author Comment

by:Jaziar
ID: 13716337
I have tried all suggestions and this last one is the only that has worked for me
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month11 days, 22 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question