Solved

Opening a response.

Posted on 2004-03-23
5
208 Views
Last Modified: 2013-12-18
I have two actions in my form one is Create and the other one is Open.
  Create has an action of @Command([Compose];"";"New Form")
  Open I need to be able to determine if the current document is new form or not. This form is filled-up and saved. If it is new I use Create if not then I open the response form made the last time the user is in.
Thanks
0
Comment
Question by:cyle
[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
  • 3
  • 2
5 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 10662667
You can't create a response to an unsaved document, so what you are asking for doesn't seem to really make sense.

The @Function for "new form" is called @IsNewDoc.

Perhaps your meaning was clouded by the fact that you used "New Form" as an example form name.  Did you really mean, "If the form on screen is of of the XYZ form type, then create a new one of the same type, otherwise open the last XYZ form type the user created."

Not sure why you would want to do that either, because YOU know where you put the button -- on the XYZ form, you want to just create a button that creates new documents, and on other forms, you want to create a button to find the last XYZ form.

To find the last XYZ form for a user, you would need a view that includes only XYZ forms (via SELECT Form = "XYZ"), and has a column sorted on user name, and a second sorted on create date, descending.  If there is an additional key (e.g., if the open document is number 12, then you really want to get the last XYZ created for number 12 by the current user), then use a compund key formula fo rthe user name and the key field.

Formula language rough example:
docKey := @Text(document_number_field);
viewKey := docKey + @Char(255) + @UserName;
viewName := "name of view goes here";
check := @DbLookup(""; viewName; viewKey ; 1);
@If(@IsError(check); @Return(@Prompt([ok]; "Not found"; "You did not create any XYZ forms for " + docKey)); CONTINUE );
@PostedCommand([OpenView]; viewName; docKey; "1");
@PostedCOmmand([OpenDocument]);
@PostedCommand([OpenView]; viewName; docKey; "0");
@PostedCommand([FileCloseWindow]);
0
 

Author Comment

by:cyle
ID: 10662802
Sorry, if my explanation is not clear.
The New Form is correct.
What the other is suppose to do is:
   When I click on Create on MainForm it gives me a another form(lets name it form2, a response) then I save this response. I then go back to the view and open form2 with all the info.
   Then we go back again to the process, the main form which has both buttons, I need to able to hide one of this button if the Mainform has a response then we use Open button if there is no response then we use Create Button. I have read a Lotus Script Notes Document RESPONSE Property but not sure how to use it.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10662969
Yes, you could use that if your database structure is that simple.

Dim ws as new notesUiWorkspace

Dim form as notesUiDocument
Set form = ws.currentDocument

Dim doc as notesDocument
Set doc = form.document

Dim responses as notesDocumentCollection
Set responses = doc.responses

if responses.count = 0 then
    ws.composeDocument .........
Else
    Dim response as notesDocument
    Set response = responses.getFirstDocument
        'this is not guaranteed to work properly
        'if there are many responses, you can't know which it will return
    ws.editDocument .... response .....
End if
0
 

Author Comment

by:cyle
ID: 10669154
Since I'm only hiding the Create button when there is a response, I do not really need to display anything.
One more where do exactly add this,in the Open button (action):Click?
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 100 total points
ID: 10670012
Yes, in click
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Suggested Courses

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