Solved

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

Posted on 2006-06-14
11
616 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
Comment Utility
How does the view open the document in the other frame?
0
 

Author Comment

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

Expert Comment

by:marilyng
Comment Utility
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
 

Author Comment

by:navgup
Comment Utility
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
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 18

Expert Comment

by:marilyng
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
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
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 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

13 Experts available now in Live!

Get 1:1 Help Now