?
Solved

Closing a form after composing a form

Posted on 2005-03-31
20
Medium Priority
?
235 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
  • 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
Technology Partners: 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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

615 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