Solved

How to prevent the Save Prompt in Notes and move to next/prev document?

Posted on 2006-06-14
11
621 Views
Last Modified: 2013-12-18
Please don't give me the obvious answer. Read my problem carefully.


In Notes (non-web), I have a frameset with 2 frames.
On the left frame i have a Customer view, listing all the Customer documents (in the view).
On the right frame i edit the Customer document selected in the left frame (just how preview works).

I also have Prev, Next button on the action bar of Customer view (within the frame), which is giving me the control to navigate to next and prev doc.  

The Problem is, when prev/next button is pressed, i want to save the changes in the document and go to the next/prev document without getting the save prompt.

I have tried putting SaveOptions (computed)= "1" and then in the QueryClose of the form, i have @SetField("SaveOptions"; "0")).

It still is giving me the Save prompt. Any suggestion?





0
Comment
Question by:navgup
  • 5
  • 5
11 Comments
 
LVL 15

Expert Comment

by:mshogren
ID: 16905912
How does the view open the document in the other frame?
0
 

Author Comment

by:navgup
ID: 16906103
by giving the (right) frame name in the "default target for link in frame" of frame properties.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16908062
Just to verify,

SaveOptions is a field on your form.  It can be editable or computed.  I usually make it editable, and default to "1".
On postModeChange if the form is in edit mode, I usually change the saveOptions value.

If I have a button that is saving the form, then the button does:

@SetField("SaveOptions";"1");
@if(@Command([FileSave]); @Do(
   @SetField("SaveOptions";"0");
   @PostedCommand([Whatever you want]));"")

----------
If you have the SaveOptions in the QuerySave event, but also push a button, the button actions will run first, and THEN the QuerySave event will run.  So, you need it in both places. :)

Second question:  Is the form properties checked to present the save dialog?  If so, then uncheck that.


0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:navgup
ID: 16911827
I m still not able to do it. could you pl give me step by step instructions. if it works i will double ur points.
0
 

Author Comment

by:navgup
ID: 16914671
Can anyone send me a good sample code or db to use frameset in notes client ? such as having next/prev button on one frame and doc edited in second frame.

0
 
LVL 18

Expert Comment

by:marilyng
ID: 16916465
Just a quick response,

First create the view with the documents that you want  to show.  
Create two View Actions:  Previous, Next.
In the Previous Action formula: @Command([NavigateNext]) or @Command([NavigatePrev])

Then Create a Frameset, select two frames design.  Name it "Main"

In the LEFT Frame, right click on the Frame and select Frame Properties
Name the frame: "NotesView"

Type: Named Element    next Option select: View
Value: click on the yellow folder and select your view
Default Target for Links in Frame:  "NotesDoc"

Set the other properties for the frame as you see fit. (like check simple appearance to not show the selection margin)
------------------
Right Click the RIGHT Frame
Select Frame Properties  
Name this Frame: "NotesDoc"
Type: Named Element
Select: Form
Value : Use the yellow folder and select the main form that you use for the view.  (or you can select a page to display as your default, if you have a page with information, etc.  This will display as default if you don't want the view displaying the first document as default)

Default Target for links in frame: "NotesDoc"

Save your frameset.

--------
Go to Database Properties
Select the Rocket Tab
On Notes Client:  Open Designated Frameset
Then Select The Frameset you just created.

Do the same for the Web Client.

Open the database.. test.


0
 
LVL 18

Expert Comment

by:marilyng
ID: 16916492
Ah, to quickly do the original request:
-----------------------------------------------------Next Document
@SetTargetFrame("NotesDoc");
@Command([EditDocument];"1");
@SetField("SaveOptions";"1");
@SetField("ThisDummy";@UserName);
@If(@Command([FileSave]);@SetField("SaveOptions";"0");"");
@Command([EditDocument];"0");
@SetTargetFrame("NotesDoc");
@Command([NavNext])
-------------------------------------------------------Previous Document
@SetTargetFrame("NotesDoc");
@Command([EditDocument];"1");
@SetField("SaveOptions";"1");
@SetField("ThisDummy";@UserName);
@If(@Command([FileSave]);@SetField("SaveOptions";"0");"");
@Command([EditDocument];"0");
@SetTargetFrame("NotesDoc");
@Command([NavigatePrev])
0
 

Author Comment

by:navgup
ID: 16917633
Are you sugesting to put these Next Document/Previous Document formulas to be on view action or form action buttons??

Have you tried this yourself?? or it is theoritical ?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16919437
Tested before I posted, and put the actions on the view, display the actions on the view action bar.  It's the quick way to make it work.   Unless you want a very long convoluted solution.  

What's the problem?  I usually make it work first, and then figure out how to make it pretty, or change it to do something else.
0
 

Author Comment

by:navgup
ID: 16920395
What am i missing ? I copied the same above code in the view action bar and i have 3 problems:
1. The document is not opening in edit mode automatically
2. When i double click on NotesDoc frame, it does change into edit mode but it prompts me to save it again.
3. On the left frame, the cursor is one step ahead. for eg. when i click "Next" to goto 2nd doc (in view), it opens the first doc on the right frame and so on.
0
 
LVL 18

Accepted Solution

by:
marilyng earned 100 total points
ID: 16922057
The document is not opening in edit mode automatically<< so when someone clicks on the view entry, and it appears in the right frame, you want it to automatically open in edit mode?

Ah,  you have to be  a bit more specific with what you want, and how capable you are in extrapolating suggestions into workable solutions :)

there are two problems that you are going to face.  If you code a button, then the user can press, CTRL + e to put the document into edit mode and CTRL +S to save it.  So, if you want to be really accurate with this you would have to decide if users can use the keyboard shortcuts, or if you want them to be limited to buttons.

For example.  If you display a view on the left, I don't have to use the prev or next buttons, I can just click on the entry to see it in the right frame.  I can bypass all of your buttons and put the document in edit mode, edit the document and save it without trapping the saveoptions.

So, you have to code for BOTH buttons and keyboard commands.  that is, if that's how you want your workflow to go.

First:
(View left, doc right.)  When you click on view entry in left frame, it appears in right frame and th e document needs to be in edit mode.
  >>>>I need to trap the form events in addition to coding the buttons. Just in case the user doesn't use the buttons.

If you add code to the form events to place a form in edit mode, it will ALWAYS open in edit mode, so consider if there is going to be a time when you don't want it to do this.

Put an editable field: SaveOptions (text) on the top of the form, hide it.

----------------------------------------------------------------------------So, you need to trap on the FORM Events.
Sub Postopen(source as uidocument)  
  if not source.editmode then
      source.editmode = true
   end if
      call source.fieldsettext("SaveOptions","0")
end sub

Sub PostModeChange
     if not source.editmode then source.editmode = true
     source.fieldsetText("SaveOptions","0")
End Sub

Sub QuerySave(Source as NotesUIDocument, continue as variant)        
     'check for some stuff
  Call source.FieldsetText("SaveOptions","1")
End Sub

Sub PostSave (Source as NotesUIDocument)
   dim doc as Notesdocument
   set doc = source.document
   doc.saveOptions = "0"
End Sub
   
--------------------------------------------------Then you need to TRAP on your BUTTONS


Save Button:
@Command([EditDocument];"1");
@SetField("SaveOptions";"1");
@If(@Command([FileSave]);@SetField("SaveOptions";"0");"");

------------------------------------------------------------

Here is what the PREV NEXT BUTTONS DO:

@SetTargetFrame("NotesDoc");                         << Sets the target frame to the right NOTESDOC
@Command([EditDocument];"1");                      << Puts the document into EDIT MODE
@SetField("SaveOptions";"1");                           << SETS SAVEOPTIONS TO "1"  (You will be prompted if you hit escape)
                                                                             I did this to add the value to the field on the next line.   But, since I'm moving
                                                                             to the next document, I want to save the current one and then move to the next one,
                                                                             Right?
@SetField("ThisDummy";@UserName);                <<Changes some value in some bogus field
@If(@Command([FileSave]);@SetField("SaveOptions";"0");""); <<Saves the document, and sets save options to "0" so you don't
                                                                             get prompted.
@Command([EditDocument];"0");                        << Takes the document out of edit mode
@SetTargetFrame("NotesDoc");                           <<Sets the target frame
@Command([NavigatePrev])                                 <<Moves to the next document

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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