Guys I am royally stumped here and any help would be very appreciated.
I have a form that collects some stuff about a project. It then usese this agent upon saving to retrieve a project number an dupdate the project counter.
The form is dually accessed both over the web and over the notes client.
For the web I call the agent in the web query save. It runs fine and does everythign it should.
For notes I call it in the Querysave event - again - calls the same exact agent, same form, same everythign bit for whatever reason, it still saves the document when ran throught he notes client, but I get an @Error where the project number should be.
Now my experience has been that things work in notes and not the web especially script but this time, its not working in notes. Also the code thiny at the bottom that usually tells you there is a script error or whatever gives me no errors.
Here is the actual Agent code.
Again works when executed over the web (fires off on web query save and the save method is via a javascript button that does javascript input validation adn then calls a do submit)
Does not work when done over Lotus Notes - action save button for which the code is :
@If(@Command([FileSave]);@Command([FileCloseWindow]);@Return(“”))
(not sure why it has all that extra crap in the save button - I inherited this app).
the script::::
Declarations:
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim profileStrings As NotesItem
INitialize code:::
Sub Initialize
On Error Goto errorHandler
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim profdoc As NotesDocument
Dim profileStrings As NotesItem
Dim countdoc As NotesDocument
Dim view As NotesView
Set db = session.CurrentDatabase
Set doc=session.DocumentContext
'doc.projmgmt_1=doc.projmgmt_1(0)+doc.projmgmt_1_1(0)
'doc.projmgmt_2=doc.projmgmt(0)-doc.projmgmt_1
'doc.projmgmt_1_1=0
If doc.count(0) = "" Then
Set view=db.GetView("count")
Set countdoc = view.getfirstdocument
'Set doc = db.GetProfileDocument("Counter")
stringval = countdoc.count(0)
countdoc.count = countdoc.count(0) + 1
Call countdoc.Save(True,True)
doc.count = Cstr(stringval)
success = doc.COMPUTEWITHFORM(False, False)
If success Then
Call doc.save(True, True)
End If
End If
Exit Sub
errorHandler:
Print "Error #" & Format$(Err) & " at line " & Format$(Erl) & ": " & Error$, 0, "Error"
End Sub
TIA script gurus