Quantcast
Channel: Domino Administrator – IT Answers
Viewing all articles
Browse latest Browse all 22

Creating a daily document with LotusScript.

$
0
0

I have created an agent to created a daily document with LotusScript.  The document creates perfectly with the agent.  This document also saves the view perfectly.  However, I am having a problem with the numbers saving in the columns of my view. 

The view has three columns.  A Date column and two numeric figure columns.  I keep getting the following message in one of my columns Error:  Incorrect Data Type for operation or @Function: Number Expected.

If I create this document manually without the agent.  All information saves in the columns with no problems.

I am thinking that my scripts may not be correct.

Here’s my initialize script:

Sub Initialize
    Dim session As New NotesSession
    Dim db As NotesDatabase
    Dim doc As NotesDocument
   
    Set db = session.CurrentDatabase
    Set doc = db.CreateDocument
    doc.Form = “UR”   
    Call doc.Save(True, True)
   
End Sub

Here’s my Click script:

Sub Click(Source As Button)
  ‘ Declare all variables
    Dim workspace As New NotesUIWorkspace
    Dim session As New NotesSession
    Dim uidoc As NotesUIDocument
    Dim view As NotesView
    Dim db As NotesDatabase
  ‘Set all variables
    Set uidoc = workspace.CurrentDocument
    Set db = session.CurrentDatabase
    Set view = db.GetView( “Copy of Stats UR-FY11″ )
  ‘Save current document, refresh “Copy of Stats UR-FY11″ view
  ‘and close document
    Call uidoc.Save
    Call view.Refresh
    Call workspace.ViewRefresh
    Call uidoc.Close
End Sub

This is the first time I have ever used LotusScript. I am trying to teach myself on this.  If I made any silly errors, please forgive me and please help..

Thanks.

 


Viewing all articles
Browse latest Browse all 22

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>