Solved

Opening a response.

Posted on 2004-03-23
5
203 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Yes, in click
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now