?
Solved

Stop editors from sending a document to EditMode

Posted on 2003-03-20
9
Medium Priority
?
201 Views
Last Modified: 2013-12-18
Hi Experts,

I have a document that I don't want people to be able to edit by double clicking or going to actions/edit
But I do want it to goto edit only if they press a special action button.

The only problem is the action button has code and it is all in formula, and the QueryModeChange also has code already
but its all in script.  Is there a way I can stop the user from editing unless they press this Action button (in formula)

Thanks in advance... Joe.
0
Comment
Question by:jpirozzolo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
  • 2
9 Comments
 
LVL 63

Expert Comment

by:Zvonko
ID: 8175510
You can not stop editing, but you can avoid changing the document :)

Add a field named SaveOptions and set it to "0"

Now your button should change this field to "1" before saving. Otherwise are people editing this document without button doing this in vain.

0
 
LVL 9

Accepted Solution

by:
Arunkumar earned 1000 total points
ID: 8176153
Have an action button on view called as edit document.

Have this code:
@SetEnvironment( "EditAccess" ; "1");
@PostedCommand( [EditDocument] ; 1 )

In the QueryOpen Event have this script
-----------------
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
'    To check the document status:    
'    If the user opens the document in Read Mode , allow him to do so
'    If the user opens the document in Edit Mode without clicking the 'Change Name' Button, stop him
'    If the user clicks the 'Change Name' button then allow him to modify the contents
     
     Set Session = New NotesSession
     EditAccess = Session.GetEnvironmentString("EditAccess")
     If Mode = 1 And EditAccess <> "1" And (Not Isnewdoc) Then
          Continue = False
     End If
End Sub
------------

in the query modechange event have the following...

------------
Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
' The environment vairable EditAccess is set when the user clicks the Change Name button on the view Action Bar to 1, indicating that
' the user can edit the document to change the manager's info.  If the user did not use the Change Name button, do not allow them
' to edit the document since the agents would not run that make the changes to documents in other databases.
     
     Set Session = New NotesSession
     EditAccess = Session.GetEnvironmentString("EditAccess")
     If Not (Source.EditMode And EditAccess = "1" ) Then
          Continue = False
     End If
     
End Sub
-------------------
In query Close have this formula,

--------------------
ENVIRONMENT EditAccess := "0";
""
----------------

-Arun.
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8176183
Zvo-Bro !
This one is mine. And Joe will be definitely giving me 500 pts with EXcellent grading just wait and see...
:-)

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 63

Expert Comment

by:Zvonko
ID: 8177328
OK :)

But read first his requirements: no change in QueryModeChange section.
He use @formula and you propose LotusScript.

But if you mange to get the points, then it is ok :)

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8177579
Hee Hee Hee.... I am lucky here too...

The button of mine has formula and the mode change event has script.

It will be easy for him to implement my solution...

:-)
0
 

Author Comment

by:jpirozzolo
ID: 8183209
Thanks guys for the quick responce.
Looks like Arun gets the gold medel on this one (sorry Zvonko).. Perfect combo of Script and formula.

Anyway thanks again and have a great weekend.

Well done ... Joe :-D  
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8183244
FYKI: That code was stolen from none other than the #1.

:-)
Arun.
0
 

Author Comment

by:jpirozzolo
ID: 8183295
Oh yes!! so it was.

Well as CRAK says better stolen well than programmed badly :D
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 8183393
oh yea!
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses
Course of the Month12 days, 4 hours left to enroll

752 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