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  >  IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

IBM Lotus Notes/Domino 8.5 Forum (includes Lotus Notes Traveler)

Sign in to participate 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 Travis J Nord on 06/20/2013

Status: Open
Comments:

AdjustDay LotusScript no flag failu... (Travis J Nord 20.Jun.13)
. . Here is a sample (Barry Shapiro 20.Jun.13)
. . You need to initialize the dTime va... (Jochen Sack 21.Jun.13)
. . . . Is there more data (Travis J Nord 21.Jun.13)




Printer-friendly

Search this forum


Sign In or Register

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

Member Tools


RSS Feeds

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

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support


 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 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


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM Web Content Manager
Lotus Enterprise Integration
Lotus Protector
Lotus Quickr
Lotus SmartSuite