Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Opening a response.

Posted on 2004-03-23
5
Medium Priority
?
214 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 300 total points
ID: 10670012
Yes, in click
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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Screencast - Getting to Know the Pipeline
Suggested Courses

916 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