Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: AdjustDay LotusScript no flag failure
Feedback Type: Question
Product Area: Notes Client
Technical Area: Application Development
Platform: Windows
Release: 8.5.3
Reproducible: Always

I have been beating my head reading up as much as I can on the notesdatetime class and how it works. For some reason I can not understand why in total this script is wrong.

So first let me explain the process I am trying to do. I have a form called assignments. This form has three major areas as they pertain to this date issue. First a button that is working, that defines the currentDay and assigns it to dateReceived, which receives the dateModifier from a drop down choice that defaults to 7, and adjustday transforms the current day to the dueDate.
The problem area: I am using the exiting Sub for this process. In this area I need to be able to adjust my dateReceived to a date other than today. The field is type date/time.

I am currently receiving no direct errors but my step throughs on the program show that all steps work except my adjustday. Below is a copy of this code that is failing.

Sub Exiting(Source As Field)

Dim session As New NotesSession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim dTime As New notesDateTime("")


Dim temp As Variant
Dim temp2 As Variant
Dim temp3 As Variant
Dim temp4 As Variant

Set db = session.CurrentDatabase
Set uidoc = ws.CurrentDocument
Set doc = uidoc.document

adjustD=doc.GetItemValue("AdjustDay")
Messagebox("AdjustDay: " +adjustD(0))

temp = doc.GetItemValue("DateReceived")
Messagebox("Assigned on: "+temp(0))
'this call is redundent but I was testing the date hand offs
Call doc.ReplaceItemValue("DueDate", temp(0) )
'this transform is also redundent again testing the date was dropping in correctly
temp2 = doc.getitemValue("dueDate")
Messagebox("Replaced dueDate initial " + temp2(0))
'setting my instanced date variable
Call doc.ReplaceItemValue("dTime",temp2(0))
'testing my instance variable has the right date
temp3=doc.getitemValue("dTime")
Messagebox("temp date usage for adjust "+temp3(0))
'intializes my adjustment modifier though I have test with statics of 1 and 7 and -72 with no luck either

Call dTime.AdjustDay(adjustD(0))
'
temp4=doc.GetItemValue("dTime")
Messagebox("Post Adjust DateDue: " + temp4(0))

Call doc.replaceItemValue("DateDue",temp4(0))
End Sub

So I realize I can remove most of the code down to but I still can't see why I am not able to pass the adjustDay with this code. Please help me understand what I am missing.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim dTime As New notesDateTime("")


Dim temp As Variant
Dim temp2 As Variant
Dim temp3 As Variant
Dim temp4 As Variant
adjustD=doc.GetItemValue("AdjustDay")
temp=doc.GetItemValue("DateReceived")
call doc.ReplaceItemValue("dTime",temp(0))
call dTime.AdjustDay(adjustD(0))
call doc.ReplaceItemValue("DateDue",dTime)


Feedback number WEBB98UNML created by ~Tanita Zenalit on 06/20/2013

Status: Open
Comments:

AdjustDay LotusScript no flag failu... (~Tanita Zenalit... 20.Jun.13)
. . Here is a sample (~Sean Eljumigon... 20.Jun.13)
. . You need to initialize the dTime va... (~Fred Asatumibu... 21.Jun.13)
. . . . Is there more data (~Tanita Zenalit... 21.Jun.13)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS