Solved

Checking if Document has been previously modified before saving!!

Posted on 2001-08-30
4
179 Views
Last Modified: 2013-12-18
Hello all

On clicking an 'Approve' button, I'm attempting to check whether the document has already been approved since I opened it and if so, I want to display a message and stop anything else happening.

This is the function I am using to check it.  It's called before anything else happens:-

*******************************************************************

Function CheckStatusChanged(uidoc As NotesUIdocument) As String
     Dim s As New NotesSession
     Dim ws As New NotesUIWorkspace
     Dim doc As NotesDocument, Doc2 As NotesDocument
     Dim db As NotesDatabase
     
     Dim sDocToFind As String
     Dim dc As NotesDocumentCollection
     Dim x As Integer
     
     Set doc = uidoc.Document
     Set db = s.CurrentDatabase
     
     sDocToFind = doc.NoteID
     Set doc2 = db.GetDocumentByID(sDocToFind)
     
     Msgbox "Saved Status: " & doc2.rStatus(0) & Chr$(13) & "Current Status: " & doc.rStatus(0)
     If Not doc2.rStatus(0) = doc.rStatus(0) Then
          CheckStatusChanged = "Yes"    
          Exit Function
     End If    
     CheckStatusChanged = "No"
End Function

******************************************************************

I open the document, someone else opens and approves the same document then when I approve it, it doesn't pick up the fact that the status has changed!!

Anybody got any ideas please?

Thanks in advance

Ian

PS If anyone has problems accessing ExpertsExchange.com at work (like I have for months), use Experts-Exchange.com instead as I guess the hypen stops the word 'sex' being created in the middle!!!
0
Comment
Question by:IanWood
[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
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
martijnmulder earned 100 total points
ID: 6441292
I guess the only thing you really can do is (and this only works when the application only exists on 1 server) create another document (approval document) and look for the existence of that document on approval. e.g. store the document unique id of the original document in the approval document and make that the key in the first column of a view ?

it's a bit more complicated but it should work.

The other option is on approval to close the document and re-open it but that would cause flashing screens....
0
 

Author Comment

by:IanWood
ID: 6441419
Cheers, out of curiousity, if I haven't saved the new document, and I get a new handle on it why doesn't it pick up the later saved version?

0
 
LVL 4

Expert Comment

by:martijnmulder
ID: 6442158
well the document goes from the disc (or nsf) into memory the moment you open it. It does not refresh itself (in memory from disc) until the next time you open it. That's why you get save conflicts when you try to save the same document at the same time.

When you get a new 'handle' on the document you only get a new pointer to the same memory address. This does not update until you close the document.
0
 

Author Comment

by:IanWood
ID: 6444251
Cheers!! I think the approval document sounds like the way to go, as that way I can track all approvals on it..


0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to Open Lotus Notes:// links in web browser 3 1,688
Scan to Email - HP 477 Printer and Lotus Notes 8 90
problem with deleted user 14 38
xss alert in domino url 9 57
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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