Domino 9 und frühere Versionen > ND6: Entwicklung
doc.lock unter Notes R6
adminnaddel:
Hallo liebe Gemeinde,
eine Db R5 für R6 klar machen und doch immer wieder auf Hindernisse stoßen >:(
Unter R5 = pdoc.lock = "1"
Unter R6 = pdoc = pdoc.lock ("1",True )
Fazit:
!! von wegen, eben nicht!! :-X
Hier ein Auszug aus meinem Problem:
We have set up an example database with only one document. This document contains a field named “Lock”.
Then we create an action button in a view with the following code:
Dim Session As New NotesSession
Dim DB As NotesDatabase
Dim DocCol As NotesDocumentCollection
Dim Doc As NotesDocument
Dim MyValue As Variant
Set DB = Session.CurrentDatabase
Set DocCol = DB.AllDocuments
Set Doc = DocCol.GetFirstDocument
MyValue = Doc.Lock(0)
The correct value of the “MyValue” variable in the document is correctly returned to you when running the code in version 5.
In version 6.x this operation triggers the following error message:
Was mache ich denn hier falsch?
lg
Andy
klaussal:
Das ist wohl ein reservierter Name !
Aus der Hilfe:
--- Code: ---On Error Goto errh
If doc.Lock("Guys", True) Then
Print "Document locked"
Else
--- Ende Code ---
klaus
Tode:
wie schon erwähnt: lock ist eine neue Methode der NotesDocument- Klasse...
Auszug aus der Designer- Hilfe:
Lock-Method
Locks a document.
Note This method is new with Release 6.
Defined in
NotesDocument
Syntax
flag = notesDocument.Lock( [ name ] [, provisionalOK ] )
Um Deinen R5- Code abzubilden musst Die eine Zeile umschreiben:
MyValue = Doc.GetItemValue( "Lock" )(0)
Gruß
Tode
adminnaddel:
@Klaus ... vielen Dank für deine Antwort!
@Tode ... vielen Dank .. probiere es gleich aus!
lg
Andy
adminnaddel:
Etwas macht nun aber stutzig ....
Mit GetItemValue erreiche aber doch nicht das was ich möchte ... ich denke ein:
Call doc.ReplaceItemValue( "lock", "1" ) wäre doch das richtige?!
lg
Andy
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln