agent to set field based on date/time elapsed

30 pts.
Tags:
LotusScript
LotusScript devlopment agent
i am writing this agent that is suposed to set the field "Outstanding" (textfield) to a value depending if a certian amount of time has elapsed dateTime2 will be Set dateTime2 = now in the end but for now i'm just trying to get it working. i get a type mismatch error and think that dateTime1&(2) arnt being assinged a value. Sub Initialize 'Dim w As New notesuiworkspace Dim s As New NotesSession Dim db As NotesDatabase Dim view As NotesView Dim Dc As Notesdocumentcollection Dim doc As NotesDocument 'dont know if notes item's are needed Dim item As NotesItem Dim item2 As NotesItem Dim item3 As NotesItem Dim Outstanding As String Dim count As Integer Set s = New NotesSession Set db = s.Currentdatabase Set view = db.GetView("10.Inspection & TestingWork Lots Statistics by Originator") Set dc =db.AllDocuments Set doc = dc.GetFirstDocument() Set collection = db.UnprocessedDocuments If (Not collection Is Nothing) Then For i = 1 To collection.Count Set doc = collection.GetNthDocument(i) Set item =doc.getfirstitem("Outstanding") Set item2 =doc.getfirstitem("DateLTRR") Set item3 =doc.getfirstitem("DateClosed") Set dateTime1 = New NotesDateTime( doc.DateLTRR(0) ) Set dateTime2 = New NotesDateTime( doc.DateClosed(0) ) If WorkLotDetails = "Concrete/Shotcrete" Then Call dateTime1.AdjustDay( 50 ) If dateTime2.dateonly > dateTime1.DateOnly Then doc.Outstanding = "1" ' End If Elseif WorkLotDetails = "Earthworks" Or WorkLotDetails = "Other" Then Call dateTime1.AdjustDay( 28 ) If dateTime2.dateonly > dateTime1.DateOnly Then doc.Outstanding = "100" ' End If End If 'error checking If WorkLotDetails = "Concrete/Shotcrete" Then Call dateTime1.AdjustDay( 50 ) If dateTime2.dateonly < dateTime1.DateOnly Then doc.Outstanding = "2" ' End If Elseif WorkLotDetails = "Earthworks" Or WorkLotDetails = "Other" Then Call dateTime1.AdjustDay( 28 ) If dateTime2.dateonly < dateTime1.DateOnly Then doc2.Outstanding = "2" ' End If End If 'error checking doc.Outstanding = dateTime2 Call doc.Save(True,False) Next End If End Sub

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following