• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 673
  • Last Modified:

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

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?

  • 5
  • 5
1 Solution
How does the view open the document in the other frame?
navgupAuthor Commented:
by giving the (right) frame name in the "default target for link in frame" of frame properties.
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:

@if(@Command([FileSave]); @Do(
   @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.

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

navgupAuthor Commented:
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.
navgupAuthor Commented:
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.

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.

Ah, to quickly do the original request:
-----------------------------------------------------Next Document
-------------------------------------------------------Previous Document
navgupAuthor Commented:
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 ?
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.
navgupAuthor Commented:
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.
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.

(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
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:


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,
@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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now