Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Notes/Domino 4 and 5 Forum

Notes/Domino 4 and 5 Forum

developerWorks

  


Agent done error
Gabrielle R Coutinho 22.May.12 02:23 PM a Web browser
Domino Designer -- LotusScript All Releases All Platforms

Hey people. I'm very new by using lotusscript. And I need a little help of you. Sorry for my poor english too.

I'm making an agent to calculate average from two fields dates on web. The agent run and show the alert but when it finished I got the error "Agent done".
I've already signed the database. In the server console theres no errors too.

Could you help me to resolve this pluzze?

Thanks in advance.

Heres the code.


MsgBox "Entrou no agente!"

On Error GoTo TrataError

Dim ses As New NotesSession
Dim db As NotesDatabase
Dim vis As NotesView
Dim col As NotesDocumentCollection
Dim contotal As Integer
Dim numeracao As Double
Dim docMig As NotesDocument
Dim doc As NotesDocument
Dim autor As Variant
Dim data() As String
Dim contpont As Long
Dim data1 As Variant
Dim data2 As Variant
Dim criacao As Variant
Dim cria As Variant

Set Webdoc = ses.DocumentContext
Set db = ses.CurrentDatabase
Set vis = db.GetView("Autores")
Set docMig = vis.Getfirstdocument()
Set col = db.Alldocuments
Set doc = col.Getfirstdocument()

criacao = docMig.dat1

MsgBox criacao

QueryString = Webdoc.Query_String_Decoded(0)

data1 = RetornaCampo(UCase(QueryString),UCase("rel_data1="))
data2 = RetornaCampo(UCase(QueryString),UCase("rel_data2="))
'cria = retornacampo(UCase(querystring),UCase("dat1="))

contpont = col.Count

contpont = 0

'criacao = RetornaCampo(UCase(QueryString),UCase("dat1"))

If doc Is Nothing Or (criacao > data2) And (criacao < data1) Then

MessageBox "Entrou na validação incorreta!"

Print "<script language=""JavaScript"" type=""text/javascript"">"

Print |var path = window.location.pathname.substring (0, window.location.pathname.toLowerCase().indexOf(".nsf") + 4);|

Print "alert('Data Fora do período inserido para análise!" ".')";

MessageBox "Data Fora do período inserido para análise!"

Print |var path = window.location.pathname.substring(0, window.location.pathname.toLowerCase().indexOf(".nsf") + 4);|

Print "</script>"

Exit Sub

ElseIf criacao < data2 and criacao > data1 Then

MessageBox "entrou no if certo, pra a analise das medias"

Print "Verificando média..."

Set doc = col.Getnextdocument(doc)

contpont = contpont + 1

End If

MsgBox contpont

contotal = contpont

numeracao = CInt(contotal/5)

Print "<script language=""JavaScript"" type=""text/javascript"">"

Print |var path = window.location.pathname.substring(0, window.location.pathname.toLowerCase().indexOf(".nsf") + 4);|

Print "alert('Média de Migrações realizada durante a semana:" + CStr(numeracao) + ".')";

MessageBox "Média de Migrações realizada durante a semana:" & CStr(numeracao), 64, "Resultado"

Print |var path = window.location.pathname.substring(0, window.location.pathname.toLowerCase().indexOf(".nsf") + 4);|

Print "</script>"


TrataError:

MessageBox "Data de criação:" & criacao & Chr(13) & "Primeira data inserida: " & data1 & Chr(13) & "Segunda data inserida:" & data2
MsgBox "Erro:" + Error + Chr(10)+ " na Linha" + CStr(Erl) + Chr(10)+ "numero" + CStr(Err)
Exit sub
End Sub






  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search


 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

  Lotus Support
Lotus Support
Product support pages index
Search knowledge base (Technotes)
Search support downloads
Lotus Support RSS

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM SmartCloud Meetings
IBM Web Content Manager
Lotus Domino Document Manager
Lotus e-learning
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow