Hi
I got QueryOpen event on form which creates a document with few fields/values in it for a user who submit the document. It happens only once if the document excists then it will not create a new document. Also it will update the same document while save/close document by code running in QuerySave event. This all works well with admin user, but other user with author access to db, it not works, document is created at opening(correctly) but while closing it is not getting updated ?
an error thrown is
error 4000 at line 106 … where this line is currently having doc.save(true, true).
this process happens in the same session.
pls help me get sort this out… thanx in advance
Subject: doc.save(true, true) error 4000 ?
I believe your user (with author access) does not have their name or role(s) listed in your authors field if it exists.
If you are setting the authors field by the backend notes classes make sure you are specifying as a such using the NotesItem class.
Subject: RE: doc.save(true, true) error 4000 ?
the ACL of db contain users with author access with create document attributes. The form does not contain any Author field (I just removed it for testing). still error throwing ???
pls help
thanx for the response.
Subject: RE: doc.save(true, true) error 4000 ?
in order for Author level access to work you must have an Author type field on the form that lists the names or roles of those who can edit the document.
Subject: RE: doc.save(true, true) error 4000 ?
Are you using doc.save(true, true) in your Query save event? No need to use that in Query save. Ofcourse I don’t know your application. But that’s the case
If you want to save something after the Query save event, try saving from the PostSave event.
Subject: RE: doc.save(true, true) error 4000 ?
I got two forms in app. Users uses form1 to submit a document for approvel, when user open form1 to create a document, a new document is created with form2 (this happens only onces - Query open event of form1 do this job). after filling form1 and at time of submition, form2 must get updated with some field values from form1. Query save event of form1 is calling one ls script library. for updation I put code in script library. It works fine for admin, but not when user change. form2 contain an author field which get filled as current session user(I just removed this, but still error)
pls help, thanx for the response.
code I used in script lib
If ctxDoc.UsrStamp(0) = “Yes” Then
Dim view1 As NotesView
Dim doc1 As NotesDocument
Dim val1 As Variant
Dim val2 As Variant
val1 = ctxDoc.TotalDays(0)
val2 = ctxDoc.nExHour(0)
Set view1 = db.GetView( "(UsrLeaveDoc)" )
Set doc1 = view1.GetDocumentByKey(s.CommonUserName)
If Not ( doc1 Is Nothing ) Then
'doc1.nLeave2 = val1 'ctxDoc.TotalDays(0)
Call doc1.ReplaceItemValue ("nLeave2", val1)
'doc1.nExtraHour = val2 'ctxDoc.nExHour(0)
Call doc1.ReplaceItemValue ("nExtraHour", val2)
'this could get fix ; gopi
Call doc1.Save(True, True)
End If
Subject: RE: doc.save(true, true) error 4000 ?
form2 get created and updated in background, form1 is only open for users.
Subject: its get corrected.
I set Author field in form2 with following formula@Name([CN];@UserName)
and its working for all users properly.
earlier I have given role name instead of the above formula, which it was not working for other users.
thanx for all responses and time spend on this matter
truly gopi