Solved

Opening a response.

Posted on 2004-03-23
5
205 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to copy mail box rules from one nsf to another 9 177
How do I delete a user in IBM Lotus Notes 2 203
Lotus notes email code 13 94
Switching from Lotus Notes to Outlook 4 49
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

803 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