Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Checking if Document has been previously modified before saving!!

Posted on 2001-08-30
4
Medium Priority
?
186 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 400 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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…

618 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