I'm modifying an old program in LotusNotes which have an agent to send document link to Approver email.
FIELD ForApprover1 := Approver;
FIELD ForApprover2 := Approver1;
FIELD AppInfo:= "Approver Info Locked";
FIELD submit:="submitted";
@If(Approver = "" & Approver1 = ""; @Do(@Command ([FileSave]);@Command([RunAgent] ;"sendmail");@SetField("ForApprover1";"Approval Locked");@SetField("ForApprover2";"Approval Locked"));Approver != "" & Status1 = ""; @Do(@MailSend(Approver; ""; ""; @Text(Subject) + " : Request To Approve : "+ @Text(docno)+@Text(dcounter); ""; "Double-click the document icon for Detail. ---> "; [IncludeDoclink]); FIELD ForApprover2:="Approval Locked");@Success);
@PostedCommand([FileSave]);
@PostedCommand([CloseWindow] )
The link will direct approver to the document in Read mode. Now I want to change it so that when approver clicks the link, it will direct them to Edit mode of the document instead of Read mode.
Is there a code which allows that?
EDIT:
I tried adding in code for QueryOpen event:
Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
Dim w As New NotesUIWorkspace
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Set db = session.CurrentDatabase
Set uidoc = w.CurrentDocument
' Get value for Approver 1 and 2
Approver_1 = uidoc.FieldGetText( "Approver_1" )
Approver_2 = uidoc.FieldGetText( "Approver_2" )
status1 = uidoc.FieldGetText( "status1" )
status2 = uidoc.FieldGetText( "status2" )
author = uidoc.FieldGetText( "Author" )
submit = uidoc.FieldGetText( "submit" )
cname = session.CommonUserName & "[redacted]"
aname = session.UserName
'If Approver 1 hv not approve the form yet, let form open direct in Edit mode
If(Status1 <> "Yes" And cname = Approver_1) Then
Call w.EditDocument (True)
End If
End Sub
But doing so will only create an error message Object variable not set
.
What else can I do to fix this?