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
Solved

Opening a response.

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 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